Connection examples for InterBase ODBC driver

Abstract: Examples from Help included with InterBase ODBC driver

  Connection Examples

Example connection string for Applications that use the ODBC function SQLDriverConnect:

1. Open("DSN=myDb;")

2. Open("DSN=myDb; UID=MCSSITE; PWD=mcssite;")

3. Open("DSN=myDb; UID=MCSSITE; PWD=mcssite; DBNAME=172.17.2.10:/usr/local/db/myDb.gdb;")

4. Open("DRIVER=InterBase ODBC driver; DBNAME=172.17.2.10:/usr/local/db/myDb.gdb;")

5. Open("DRIVER=InterBase ODBC driver; UID=MCSSITE; PWD=mcssite; DBNAME=172.17.2.10:/usr/local/db/myDb.gdb;")

also

6. Open("DRIVER=InterBase ODBC driver; UID=MCSSITE; PWD=mcssite; DBNAME=dummy;")

dummy – is an alias derived from the InterBase security database (admin.ib). If the environment variables ISC_PASSWORD and ISC_USER are set then the driver will use these.

DBNAME string for remote connect Comments
172.17.2.10:/usr/local/db/myDb.gdb using the server IP address, with a file name following Unix notation
myserver:/usr/local/db/myDb.gdb using the server name, with a file name following Unix notation
172.17.2.10/3051:/usr/local/db/myDb.gdb using the server IP address and specifying an alternate port, with a file name following Unix notation
myserver/3051:/usr/local/db/myDb.gdb using the server name and specifying an alternate port, with a file name following Unix notation
172.17.2.10:c:\db\myDb.gdb using the server IP address, with a file name following Windows notation
myserver:c:\db\myDb.gdb using the server name, with a file name following Windows notation
172.17.2.10/3051:c:\db\myDb.gdb using the server IP address and specifying an alternate port, with a file name following Windows notation
myserver/3051:c:\db\myDb.gdb using the server name and specifying an alternate port, with a file name following Windows notation
127.0.0.1:/usr/local/db/myDb.gdb using the loopback interface, with a file name following Unix notation
localhost:/usr/local/db/myDb.gdb using the loopback interface, with a file name following Unix notation
127.0.0.1:c:\db\myDb.gdb using the loopback interface, with a file name following Windows notation
localhost:c:\db\myDb.gdb using the loopback interface, with a file name following Windows notation
DBNAME string for local connect Comments
C:\db\myDb.gdb local connection on a Windows Server
/usr/local/db/myDb.gdb local connection with a file name following Unix notation

Example alias: If you have a database alias setup in the security database (admin.ib) e.g. set

    dummy = c:\data\myDb.gdb
    or
    dummy = /usr/local/db/myDb.gdb
DBNAME string for use alias Comments
172.17.2.10:dummy remote connection using the server IP address and an alias
myserver:dummy remote connection using the server name and an alias