devxlogo

A Fabricated ADO Recordset

A Fabricated ADO Recordset

A disconnected recordset is a recordset which does not hold an active connection. A fabricated recordset can be viewed as a variation of a disconnected recordset. The variation in the fabricated recordset is that the connection is never established. You can use this type of ADO recordset object as a UDT.

Under normal circumstances, when the number of UDT objects you need to store increases, the complexity seek Algorithm and time fluctuates. But the fabricated recordset supports a large number of datatypes and the seek is optimized (thanks to the guys at Redmond).

Use the following code snippet to create a Fabricated recordset:

#import "C:\Program Files\Common Files\System\ado\msado15.dll"no_namespace named_guids rename("EOF" ,"adEOF")_RecordsetPtr rs;HRESULT hr = CoInitialize(NULL);try{  hr = rs.CreateInstance(__uuidof(Recordset));       rs->CursorLocation = adUseClient;       rs->Fields->Append("Empid",adBSTR,10,adFldUpdatable);       rs->Fields->Append("EmpName",adBSTR,30,adFldUpdatable);       rs->Fields->Append("EmpDept",adBSTR,30,adFldUpdatable);hr = rs->Open(vtMissing,vtMissing,adOpenDynamic,adLockOptimistic,-1);//Perform Insertrs->AddNew();rs->Fields->GetItem("Empid")->Value = OLESTR("E001");rs->Fields->GetItem("EmpName")->Value = OLESTR("Kaams");rs->Fields->GetItem("EmpName")->Value = OLESTR("DevX");//Perform Any other operations here.rs->Close();
See also  Why ChatGPT Is So Important Today
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist