PRB: Error Message Returned with Server-Side Cursorlocation for MS Access Database with DataEnvironment (220888)
The information in this article applies to:
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
This article was previously published under Q220888 SYMPTOMS
If you use Microsoft Access (MSAccess) to set the Command object CursorLocation property to server-side, you may get the following error message when you invoke the command:
(-2147220992) The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another.
CAUSE
You cannot get the AutoNumber value after insert unless you use a server-side cursor with MSAccess OLE-DB Provider. The DataEnvironment.Command object allows the CursorLocation to be set to server-side with an MSAccess database but does not work when it is invoked.
RESOLUTION
To resolve this problem, you must use the DataEnvironment.rsCommand object to specify a server-side cursor in order to return the AutoNumber value after insert. Set the CursorLocation to adUseClient for the DataEnvironment.Command object. Before you invoke the DataEnvironment.Command object, specify the cursor location of the recordset object with DataEnvironment.rsCommand.CursorLocation = adUseServer, and then refer to the rsCommand object for inserting a new row. See the code sample in the "More Information" section for details.
STATUS
This behavior is by design.
REFERENCESFor additional information, click the article numbers below
to view the articles in the Microsoft Knowledge Base:
195910 INFO: Identity (AutoIncrement) Columns in ADO or RDS
190370 PRB: AutoNumber Field Is Not Incremented When Using ADO
Modification Type: | Major | Last Reviewed: | 8/23/2001 |
---|
Keywords: | kbDSupport kbprb KB220888 |
---|
|