Re: Error accessing Oracle date fields



Yes, this is C++. No, I am not using bound fields.

The code to create the recordset is:

_com_util::CheckError(pDataRec.CreateInstance(__uuidof(Recordset)));
pDataRec->CursorLocation = adUseClient;
pDataRec->PutRefActiveConnection(m_pConnect.GetInterfacePtr());
_com_util::CheckError(pDataRec->Open(bstrSQL, vtMissing, adOpenStatic,
adLockBatchOptimistic, -1));
pDataRec->PutRefActiveConnection(NULL);
pDataRec->MarshalOptions = adMarshalModifiedOnly;

Where bstrSQL is essentially, "select * from tablename". And then, all
I am doing to access the recordset is:

_variant_t vtItem = pDataRec->Fields->Item[bstrColumn]->Value;

I appreciate your quick response. Thanks for looking at this.

.



Relevant Pages

  • Re: how to SELECT * except for one field?
    ... I want to SELECT * but omit one field ... function OmitOneField(cat, tablename, thisfield) ... set conn = server.createobject ... OR, you could use a recordset, like this... ...
    (microsoft.public.inetserver.asp.db)
  • Re: how to count a recordset
    ... "Select countfrom TableName where ContitionX" will return a count of the ... FieldName, you would use something almost like what you proposed: ... >> the number or records in the recordset. ... > Set moConn = New ADODB.Connection ...
    (microsoft.public.vb.database.ado)
  • Re: how to count a recordset
    ... > the number or records in the recordset. ... Or as you say depending on the type of cursor(since I didn't define one, ... "Select CountFieldName From TableName Where ConditionX" ...
    (microsoft.public.vb.database.ado)