ADO recordset returns -1

From: Dennis (dennisbrininger_at_comcast.net)
Date: 08/15/04


Date: Sat, 14 Aug 2004 21:46:24 -0700

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*****************



Relevant Pages

  • Please help with ASP.NET Database Connection
    ... >DataGridEmail.aspx (Connection String) ... >Dim myConnection as NEW ... >Sub Page_Load ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: SQLclient fill method get exception error
    ... connection and if the credentials you supply in the DataAdapter Connection ... the server to permit access to the Northwind database. ... > SQL Server is not installed or access denied. ... > Northwind database ok and ole db seems to work all right. ...
    (microsoft.public.data.ado)
  • error 80004005 Unspecified Error
    ... I'm getting the following error and can't for the life of ... Dim rsdata ... 'Create the Connection String ... 'Create the Record Set ...
    (microsoft.public.scripting.vbscript)
  • Is my password visible when opening a standard user connection from visual basic?
    ... am opening a connection for a user that has a standard login (not an ... Dim myConnection As Connection ... of the password can be avoided by modifying the tSQL statement from ...
    (microsoft.public.sqlserver.security)
  • Re: ADO.NET and Sleeping processes
    ... What I'm trying to figure out is why my connection is not being release back to the pool. ... "amerrell" a écrit dans le message de ... > Dim myConnection As New SqlConnection) ...
    (microsoft.public.dotnet.framework.adonet)