Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
ADO recordset returns -1
I have a connection to the Northwind database from
Excel. My queries work find except when I request the number of records I always get -1. Is there something I'm missing? Here's a section of my code if this helps: Thank you in advance, Dennis *************start code**************** Dim myConnection As String Dim rsData As ADODB.Recordset '=================================== 'Create a connection to Northwind DB '=================================== myConnection = "Provider=Microsoft.jet.oledb.4.0;" & _ "Data source=C:\ProgramFiles\Microsoftoffice\" & _ "Office10 \Samples\Northwind.mdb;" sSQL = "SELECT * FROM Categories" Set rsData = New ADODB.Recordset rsData.Open sSQL, myConnection MsgBox rsData.RecordCount ************end code***************** |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Index with mulitple value returns and muliple column returns | Excel Worksheet Functions | |||
Date returns always returns: 00 January 1900 | Excel Worksheet Functions | |||
Recordset.Recordcount Returns -1! | Excel Programming | |||
Type recordset/recordset? | Excel Programming | |||
DAO query/recordset returns with field names | Excel Programming |