[unixODBC-support] How to odbc.ini and odbcinst.ini -- or how to Server=??? in DSN-Less connect

Nick Gorham nick.gorham at easysoft.com
Mon Jun 2 17:48:47 BST 2008


Michael Higgins wrote:

>Hello list --
>
>The problem I've had is that none of the DRIVER definitions seem to get
>picked up in SQLDriverConnect via perl-dbi.
>
>I use DBD::ODBC to connect. Using a defined DSN works, but I want a
>distributable app.
>
>  
>

It should work as long as the Driver= line in odbc.ini points to a 
driver in odbcinst.ini

so in odbcinst.ini

[MyDriver]
Driver = /path/to/my/driver.so

and in odbc,ini a entry that matches would be

[MyDsn]
Driver = My Driver

Then you could connect with

DSN=MyDsn

or

Driver={My Driver}

I don;t have a FreeTDS entry, but this is much the same and works using 
the make test in the DBD module instalation

odbcinst.ini

[Easysoft ODBC-SQL Server]
Driver     = /usr/local/easysoft/sqlserver/lib/libessqlsrv.so
Setup       = /usr/local/easysoft/sqlserver/lib/libessqlsrvS.so
Threading       = 0
FileUsage       = 1
DontDLClose     = 1
UsageCount      = 1

Values passed to perl

DBI_DSN="dbi:ODBC:DRIVER={Easysoft ODBC-SQL 
Server};Server=192.168.250.71;Database=Test"
DBI_USER=test
DBI_PASS=test

-- 
Nick Gorham
Easysoft Limited
http://www.easysoft.com, http://www.unixODBC.org




More information about the unixODBC-support mailing list