Easysoft
ODBC Drivers for Oracle, SQL Server, Firebird, ISAM, InterBase, Sybase, MS Access & more.

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?
Yes
No
Maybe
 
* Please select one option based on your first choice:
I'm very satisfied
I think it will help, but I haven't tried it yet
It is helpful, but I need more information
It is helpful, but hard to understand
Seemed relevant in search results, but didn't help me
The information is incorrect
The page contains one or more broken links
 
  Suggest new content or let us know how we can improve this content:

 
  (* Required Fields)   



© 1993 - 2008 Easysoft Limited. All rights reserved.