Paul Kraemer
2008-06-11 17:27:00 UTC
Hi,
I have created an unbound form in Access 2007 with some controls on it. I
have a table in a MS SQL Server 2005 database with fields that correspond to
the controls on my unbound form.
I want to write code that will request one (and only one) record from the
SQL server table based on an ID field that I want to pass as a parameter. I
want to use this one row recordset to populate the controls on my unbound
form. I want the SQL server backend to do all the work in retrieving this
record. I want the Access front end to do as little as possible.
I am trying to find out the best way to do this. Should I first create a
stored procedure in SQL Server that takes one parameter for the ID and
returns the corresponding row from the table? Then should I create a
pass-through query in Access that calls the SQL Server stored procedure? If
so, what is the best way to pass a parameter to the stored procedure? Do I
have to use string concatenation to place the parameter value in the middle
of the SQL string that is tied to the pass-thru query? Or is there a better
way to pass parameters?
Thanks in advance,
Paul
I have created an unbound form in Access 2007 with some controls on it. I
have a table in a MS SQL Server 2005 database with fields that correspond to
the controls on my unbound form.
I want to write code that will request one (and only one) record from the
SQL server table based on an ID field that I want to pass as a parameter. I
want to use this one row recordset to populate the controls on my unbound
form. I want the SQL server backend to do all the work in retrieving this
record. I want the Access front end to do as little as possible.
I am trying to find out the best way to do this. Should I first create a
stored procedure in SQL Server that takes one parameter for the ID and
returns the corresponding row from the table? Then should I create a
pass-through query in Access that calls the SQL Server stored procedure? If
so, what is the best way to pass a parameter to the stored procedure? Do I
have to use string concatenation to place the parameter value in the middle
of the SQL string that is tied to the pass-thru query? Or is there a better
way to pass parameters?
Thanks in advance,
Paul
--
Paul Kraemer
Paul Kraemer