Microsoft Oledb provider for SQL Server (SQLOLEDB)

<< Click to Display Table of Contents >>

Navigation:  Getting Started > OLE DB providers >

Microsoft Oledb provider for SQL Server (SQLOLEDB)

Previous pageReturn to chapter overviewNext page

Problems with this provider

After committing or rolling back changes for a connection al the open recordsets will be closed, unless you set an option on the recordset before you open it (Ms Microsoft Knowledge Base Article - Q321714). You can avoid this with the following code:


oRs := AdoRecordset{}

   oRs:ActiveConnection := oConnection

   // note the following two lines will only work With SqlOleDb 

   // And BEFORE opening the cursor

   oRs:Properties:[Item, "Preserve On Commit"]:Value := TRUE

   oRs:Properties:[Item, "Preserve On Abort"]:Value := TRUE

   oRs:Open("SELECT * FROM MyTable", .....)


Some cursor type options, such as location AdUseServer in combination with AdOpenDynamic will not return the true number of records. Xs2Ado will return


Stored procedures that return a RecordSet and also an Out parameter with a ServerSide cursor, will only return the Out parameter after the recordset is closed