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 ‘recordset object’

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.

PRB: Dynaset, Snapshot, and Table Objects No Longer Available

Symptoms
If you try to dimension a Dynaset, Snapshot, or Table object variable andusing DAO 3.0 (Visual Basic version 4.0 data access objects), you willreceive this runtime error:

User-defined type not defined.If you replace the Dynaset, Snapshot, or Table object with the Object orRecordSet type and use methods such as CreateDynaset, CreateSnapshot, orOpenTable that are tied to the Dynaset, Snapshot, or Table types, you willreceive this error:

Feature not available.
Resolution
Visual Basic version 4.0 has replaced the older Dynaset, Snapshot, andTable objects with a single RecordSet object. This object can take on theattributes of any of the older three making it much more powerful andflexible.

PRB: “Too Many Columns Defined in the Rowset” Error Message

Symptoms
Running under versions of Microsoft Data Access Components (MDAC) prior to 2.5, you get the following error when choosing a Recordset object:

Run-time error ‘-2147024882 (8007000e)’Too many columns defined in the rowset.Running under MDAC 2.5 and later, you get the following error:

Run-time error ‘-2147024882 (8007000e)’:Rowsets cannot contain more than 2048 columns.
Resolution
Prior to MDAC 2.5, the client-cursor engine supported a maximum of 255 fields.
Under MDAC versions 2.5 and later, the client-cursor engine supports a maximum of 2048 fields.