 |
Tech GURU

Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Fri Aug 08, 2008 5:40 pm
[2.35] Bug with RecordCount property of RecordSet COMObject |
This is actually something I've noticed for several versions now but finally got around to posting.
If you create an ADODB connection and query the database, the RecordCount property of the RecordSet will always return -1 even if you have multiple rows of data returned. I realize this may become moot with the DB rewrite. Is there is another way to determine number of rows returned? I may look into the GetRows command.
[Edit] So much for that idea. GetRows returns a 2-dimensional array and %arrays uses one dimensional arrays. Guess it's time to look at LuaSQL. |
|
_________________ Asati di tempari! |
|
|
 |
Vijilante SubAdmin

Joined: 18 Nov 2001 Posts: 5182
|
Posted: Fri Aug 08, 2008 8:07 pm |
The problem with RecordCount actually stems from MS's ADODB implementation. It is always -1 unless the cursor type is set a certain way. I remeber seeing it in the documentation somewhere, but I didn't save a specific link to that documentation and would have to read all of it again to find it.
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
 |
Tech GURU

Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Fri Aug 08, 2008 11:32 pm |
Thanks for the info Viji. I found the correct CursorLocation.
For those interested the the CursorLocation required is adUseClient, the command to set it is as follows:
Code: |
CALL %comset(rs,"CursorLocation",3) |
Where rs is the RecordSet you defined. |
|
_________________ Asati di tempari! |
|
|
 |
Tech GURU

Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Sat Aug 09, 2008 4:35 am |
Curiously enough now that I've figured it out, I've decided to use Lua instead. It should be easier and I can be fairly assured that everyone will have it.
|
|
_________________ Asati di tempari! |
|
|
 |
|
|