Results 1 to 2 of 2

Thread: ADO without ODBC

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2000
    Posts
    21
    Can I use ADO to access other database such as Paradox without using the ODBC? If it is possible, please show me the source code on how to establish the connection directly using ADO to access Paradox. Thanks.

    FYI - I've realise that ADO connection using ODBC is quite slow.

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    Code:
        Dim cn As ADODB.Connection
        Dim rs As ADODB.Recordset
        
        Set cn = New ADODB.Connection
        
        'open connection to folder that contains DB files
        cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & ";Extended Properties=Paradox 5.x"
        
        Set rs = New Recordset
        
        'open DB file as recordset -- my file is called CATEGORI.DB
        rs.Open "Select * from Categori", cn
        
        'show data
        Do Until rs.EOF = True
            Debug.Print rs.Fields(1).Value
            rs.MoveNext
        Loop
        
        'cleanup
        rs.Close
        cn.Close
        
        Set rs = Nothing
        Set cn = Nothing

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