G
Guest
HowTo bind a form's recordsource to result of a pass-through query with input parameters using ADODB (not Jet please)
through query with input parameters using ADODB (not Jet-----Original Message-----
HowTo bind a form's recordsource to result of a pass-
"Billy Yao [MSFT]" said:Hi Sparky,
Thank you for your update! After reviewing the whole thread, I understand that you would like to bind Access
Forms to ADO Recordset(s), where the back-end database is a SQL Server database.
Based on my experience, there are limitations when binding forms to the ADO record. (The previous
method "Dynamically set the RecordSource property" seems good, but it meets some performance
issues) In Access 2000, you may meet with the known issue that the bound form is read-only:
227053 ACC2000: Forms Based on ADO Recordsets Are Read-Only
http://support.microsoft.com/?id=227053
In Access 2002 and later, to bind a Microsoft Access form to a recordset, you must set the Recordset
property of the form to a valid Data Access Objects (DAO) or ADO Recordset object. However, there are
still two main requirements for supporting updateability when you bind a form to an ADO recordset that is
using SQL Server data:
The ADO recordset's connection must use the Microsoft Access 10.0 (Access 2002) OLEDB provider as its
service provider.
The ADO recordset's connection must use the Microsoft SQL Server OLEDB provider as its data provider.
When you create ADO recordsets within Microsoft Access, you have a choice as to which ADO connection
will be used by the recordset. Your ADO code can share the ADO connection that Microsoft Access is using
for the SQL Server database currently open in an Access project (ADP) file; or you can programmatically
create a new ADO connection to a different SQL Server database.
For detailed code to bind the form to an ADO recordset (SQL Server), please refer to the topic "Opening a
Separate ADO Connection" in the following KB article #281998:
281998 How to Bind Microsoft Access Forms to ADO Recordsets
http://support.microsoft.com/?id=281998
For the second issue of "a datasheet to be filled with the recordset", I recommend you use the Form
Datasheet View to solve this issue if feasible.
If there is anything else we can assist you with, please feel free to post it in the group. Thanks for your
cooperation.
Best regards,
Billy Yao
Microsoft Online Support