Easysoft ODBC-InterBase Driver

Using Microsoft ActiveX Data Objects (ADO) from Microsoft Visual Basic or Visual Basic for Applications (VBA), how do I connect to my InterBase database without setting up an ODBC data source?

Article:
00944
Last Reviewed:
16th November 2005
Revision:
1

This article describes how to use a DSN-less connection that connects to an InterBase database from Visual Basic or VBA by using the Easysoft ODBC-InterBase Driver.

  1. Create a Connection object:
    Dim con As New ADODB.Connection
    
  2. Use the Open method to connect to the database. For example:
    con.Open "Driver={Easysoft Interbase ODBC};" _
        & "Database=myinterbaseserver:c:\myinterbasedatabase.gdb;" _
        & "UID=myinterbaseusername;PWD=myinterbaseusername"
    

    For more information about the Easysoft ODBC-InterBase Driver attributes that you can specify in the Open method’s ConnectionString argument, see the Easysoft ODBC-InterBase Driver documentation.

  3. You can then query the connection using a Recordset object. The following code fetches some data and displays the results in the Immediate window:
    Dim rs As New ADODB.Recordset
    
    rs.Open "select column from mytable", con
    
    Do Until rs.EOF
       Debug.Print rs.Fields(0)
       rs.MoveNext
    Loop
    
  4. Close any used recordsets and connections:
    rs.Close
    con.Close
    

    Note When you close a connection in ADO, the connection will only close in your program. ADO will keep the connection alive in case you choose to connect again.

Applies To

Knowledge Base Feedback

* Did this content help you?
* Please select one option based on your first choice:

(* Required Fields)