From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

what is wrong with this ado 2.6 code?

I am trying to do something very simple. I merely want to get a field from an SQL table. Here is my code. Everything works fine except when I look at the lRecords, I get -1, even though the iRc=0. Please tell me what is wrong?


iRc = ADODB_New_Connection (NULL, 1, LOCALE_NEUTRAL, 0, &CAOConnect);
iRc = ADODB_Connection15Open (CAOConnect, NULL, "Provider=MSDASQL;DSN=CHIW",
"XXXXX", "yyyyyy", -1);
for (a=0;a<100;a++)
{
iRc = ADODB__ConnectionExecute (CAOConnect, NULL,
"SELECT * from doc_ids WHERE Doc_ID<>''",&varInt, -1, &CAORecordSet);

iRc = ADODB__RecordsetGetRecordCount (CAORecordSet, &errinfoTest,&lRecords);
}
iRc=ADODB_Recordset15Close (CAORecordSet, NULL);
iRc=ADODB__ConnectionC
lose (CAOConnect, NULL);
0 Kudos
Message 1 of 1
(2,452 Views)