dcsimg
Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: C
Expertise: Intermediate
Nov 25, 2003

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


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 Insert

rs->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();
Kamesh S
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date