LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Index with mulitple value returns and muliple column returns solar+CSE Excel Worksheet Functions 4 June 12th 09 04:43 PM
Date returns always returns: 00 January 1900 ArcticWolf Excel Worksheet Functions 2 September 11th 08 12:31 PM
Recordset.Recordcount Returns -1! Sauron[_24_] Excel Programming 1 June 28th 04 09:11 AM
Type recordset/recordset? FlaviusFlav[_9_] Excel Programming 4 May 24th 04 12:16 PM
DAO query/recordset returns with field names Seth[_4_] Excel Programming 0 August 18th 03 08:36 PM


All times are GMT +1. The time now is 01:19 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"