Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADO returns 0 records
Message
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00262739
Message ID:
00262882
Views:
17
>>I'm trying to get Ado working with some Fox databases and keep getting 0 records. The State for both the connection & recordset objects is 1 after the open. I'm using a System DSN pointing to the DBC.
>>
>>Here's the code:
>>oConn = CreateObject("ADODB.Connection")
>>oConn.Open("galsinc")
>>oRS = CreateObject("ADODB.RecordSet")
>>oRs.ActiveConnection = oConn
>>oRs.Source = "SELECT * FROM Customers"
>>oRs.Open
>>?oRs.ReccordCount
>>
>>The last line always returns -1.
>>
>>Grrrr....
>That has to do with the default cursortype. If you don't specify it, Cursortype is adOpenForwardOnly, and RecordCount does not have a value until you move through the records. As Bob said, you may already have your recordset populated. With this cursor type you can check for an empty result set if EOF and BOF are both true.


Setting the CursorLocation = adUseClient did the trick for the RecordCount.

Thanks to all
Paul G Brown, MCSD
Paul G Brown
paul@paulgbrown.com
Previous
Reply
Map
View

Click here to load this message in the networking platform