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

Lukasz Szybalski szybalski at gmail.com
Mon Jun 2 19:29:31 BST 2008


On Mon, Jun 2, 2008 at 11:48 AM, Nick Gorham <nick.gorham at easysoft.com> wrote:
> 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
>
> _______________________________________________
> unixODBC-support mailing list
> unixODBC-support at easysoft.com
> http://mail.easysoft.com/mailman/listinfo/unixodbc-support
>


The way I connect to sqlserver on linux in python.

1. I use dsnless connection but still need a driver installed.
2. You need to install driver http://lucasmanual.com/mywiki/unixODBC
on windows that is done for you and driver name is "sql server" On
linux you have to install it. I usually call it "TDS" but I guess you
could call it "SQL Server" to make things easier.
3. Provide driver and tds version on a connection string in python.
4. In case this is helpful see:
http://groups.google.com/group/sqlalchemy/browse_thread/thread/36fd2e935b165d70

Lucas

Lucas



More information about the unixODBC-support mailing list