Microsoft KB Archive/223230

= ACC2000: Error Setting Recordset Property of a Form =

Article ID: 223230

Article Last Modified on 1/26/2005

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q223230



Advanced: Requires expert coding, interoperability, and multiuser skills.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).



SYMPTOMS
When you set the Recordset property of a form programmatically, if the source of the recordset's data is not a local object, you receive one of the following error messages when you open or close the form:

The Microsoft Jet database engine cannot find the input table or query '  and Password= ''' to the correct values. Make sure that the user ID has the appropriate permissions to perform this operation on the database. Private Sub Form_Load Dim cn As New ADODB.Connection Dim rs As New ADODB.Recordset

cn.ConnectionString = "Provider=MSDataShape;" & _ "Data Provider=SQLOLEDB;Data Source=;" & _ "Initial Catalog=;User ID= ;Password= ;" cn.Open rs.LockType = adLockOptimistic rs.CursorLocation = adUseClient rs.ActiveConnection = cn  rs.Open "SELECT * FROM ;" Set Me.Recordset = rs End Sub NOTE: In the code, replace  with the name of your SQL Server computer, replace  with the name of a database on the SQL Server computer, and replace  with the name of a table in the SQL Server database.  On the View menu, click Form View. If the properties dialog box is not already open, click Properties on the View menu. Change the ControlSource property of the text box to ContactName.

NOTE: The text box should now be populated with data. Close the form and click Yes to save the changes. Accept the default form name. Note that you receive the following error message:

The Microsoft Jet database engine cannot find the input table or query 'Customers'. Make sure it exists and that its name is spelled correctly.

</li></ol>

Additional query words: pra alert

Keywords: kberrmsg kbbug kbpending KB223230

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.