Results 1 to 8 of 8

Thread: [RESOLVED] Getting the Recordcount

Threaded View

  1. #1

    Thread Starter
    Addicted Member charmedcharmer's Avatar
    Join Date
    Sep 2003
    Posts
    211

    [RESOLVED] Getting the Recordcount

    Hey guys a lil help pls...

    VB Code:
    1. Dim objDB As ADODB.Connection
    2. Dim rs As ADODB.Recordset
    3.  
    4. Private Sub Command1_Click()
    5.    rs.Open "select * from card_Header", objDB.ConnectionString, , , adCmdText
    6.    Debug.Print rs.RecordCount
    7. End Sub
    8.  
    9. Private Sub Form_Load()
    10.   Set objDB = New ADODB.Connection
    11.   Set rs = New ADODB.Recordset
    12.   objDB.Open "provider=microsoft.jet.oledb.4.0;data source=D:\Documents and Settings\Ruikeish\My Documents\mrserver.mdb"
    13.  
    14. End Sub

    Why does Debug.print rs.RecordCount prints -1? instead of printing the no. of records of the table.

    Thanks a lot...
    Last edited by charmedcharmer; Nov 15th, 2004 at 02:01 AM.
    C++ Programming is overwhelming.

    Dont let it overwhelm you or you'll fall into the oblivion of its perfection

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width