Visual Basic Q&A

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries Tagged ‘cursor’

PRB: RDO/Jet: Run-Time Error 40069; Client Cursor Error 11 or 12

Symptoms
When you run a SELECT statement against the Microsoft Jet ODBC driver usingRDO and the client batch cursor engine, you receive one of the followingtwo error messages:

Run-time error 40069
Client Cursor: 11 – No update tables are specified
-or-

Run-time error ‘40069′:
Client Cursor: 12 – No key columns are specified for the update table
Resolution
When using the client batch cursor engine, and opening a static resultset,you must use the same case as in the table when typing field names into theSELECT clause of the SQL statement. This applies to the primary key fieldand any BLOB (Binary Long Object) columns–LongVarChar and LongVarBinary.

PRB: ODBCDirect Cursor Not Valid After Transaction Commits

Symptoms
When you use ODBCDirect with Visual Basic, you receive the following error on accessing a recordset object that was created inside of a transaction that has been committed or rolled back:

3670 Cursor is not valid
Resolution
This error occurs because you are using server-side cursors on your connection and the cursor is being closed when the transaction is committed or rolled back. Whether a server-side cursor is closed on a transaction commit or rollback depends on the database driver that you are using. For the SQL Server driver, the default is to close the server-side cursor on the commit or rollback of a transaction.

BUG: Property Page of Remote Data Control Causes an Error

Symptoms
Pressing the ESC key while the cursor is in the SQL text box of theGeneral Tab in the property page of the Remote Data Control causes a blankGeneral tab. When you click the Colors tab and then click the General tabagain, an application error occurs and Visual Basic ends. The SQL text boxcan be empty or contain characters. Clicking the Cancel button on thewindow correctly closes the window. This behavior only occurs under theWindows 95 operating system.To work around this behavior, programmatically set the properties ofremote data control or use the Properties window of the Remote Data Objectto set the properties.
Resolution
Microsoft has confirmed this to be an issue in the Microsoft productslisted at the beginning of this article. Microsoft is researching thisissue and will post new information here in the Microsoft Knowledge Baseas it becomes available.

PRB: ADO to SQL Server Through ODBC Does Not Support adAsyncFetchNonBlocking When You Use Server-Side Cursors

Symptoms
If you attempt to use ActiveX Data Objects (ADO) to access SQL Server databases through the ODBC provider (MSDASQL), you will receive the following error if you specify adAsyncFetchNonBlocking with Server-side cursors:

-2147217890 lRowsOffset would position you past either end of the rowset, regardless of the cRows value specified; cRowsObtained is 0. The following error is returned from ADO 2.5:

-2147217890 No rows were returned because the offset value moves the position before the beginning or after the end of the rowset.NOTE: If you are using the SQLOLEDB provider you will not see this error message. However, fetching is still not supported for the cursor and it is blocked until the cursor is fully populated.
Resolution
The adAsyncFetchNonBlocking recordset option is not supported with a Server cursor. Additional enhancements would be required for the server and client in order to implement this feature. The two way communication necessary to support adAsyncFetchNonBlocking with a server cursor is not available at this time.

BUG: AbsolutePosition Property Returns Different Results

Symptoms
When you use the Remote Data Objects (RDO) version 2.0 in either VisualBasic 5.0 or Visual Basic 6.0, with an Oracle 7.x or 8.x database, usingthe Microsoft ODBC for Oracle driver, the AbsolutePosition property of therdoResultset object produces different results depending on the Cursorlocation as set by the CursorDriver property of the rdoConnection orrdoEnvironment object.
Using the rdUseServer cursor library, the AbsolutePosition property reportsthe last row in the Resultset. When tested a second time it returns thecorrect results based on its setting.
If you use either the rdUseODBC or rdUseClientBatch cursor libraries, theresults returned will always be correct.
NOTE: This code has also been tested against Microsoft SQL Server withouterror.
Resolution
The workaround is to use a MoveLast on the Recordset or not to use theCursorDriver properties of rdUseServer or rdUseIfNeeded when the results ofthe AbsolutePosition property must be accurate. The CursorDriver propertiesof rdUseOdbc and rdUseClientBatch produce accurate AbsolutePositionproperty results.