About Us
Products
Purchase
Downloads
Support
Forums
Contact Us
Site
 Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: 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!
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: 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
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: 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!
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: 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!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net