LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ADODB._Connection and RecordCount

I need some help in getting RecordCount to show positive value. Please find attached Untitled2.vi. Right now it keeps coming up with -1. Thanks.
0 Kudos
Message 1 of 7
(4,258 Views)
Find attached VI.
As ADO help states, "The cursor type of the Recordset object affects whether the number of records can be determined. The RecordCount property will return -1 for a forward-only cursor, the actual count for a static or keyset cursor, and either -1 or the actual count, depending on the data source, for a dynamic cursor."
Thus, you have to change the cursor type (when your Recordset is closed, otherwise it produces an error).

Hope this helps.

p.s.: use one "Move First" before that loop in order to avoid the case structure inside.
Message 2 of 7
(4,258 Views)
Thanks. Your suggestion helps.
0 Kudos
Message 3 of 7
(4,258 Views)
Please how can I get a copy of the ADO help you mentioned? Thank you.
0 Kudos
Message 4 of 7
(4,258 Views)
If you right click the "RecordCount" property icon, you have an entry for its related help ...

Hope this helps
0 Kudos
Message 5 of 7
(4,258 Views)
I tried the right click but nothing came up. I'm also trying to re-install the package. If this doesn't help then I will resolve to getting the document elsewhere. Thanks.
0 Kudos
Message 6 of 7
(4,258 Views)
Try to right click the bottom part of the icon (above property name - as shown in attached picture ... ). If there is no entry for help, take a look in Windows' folder, Help subfolder and try those files starting with "ado" (should be Ado210.chm). If you cannot find it, email me at labviewer@yahoo.com and I'll reply to you the help file.
Good Luck!
0 Kudos
Message 7 of 7
(4,258 Views)