in reply to Re: Perl, DBD and SQL Server 2008 (R2)
in thread Perl, DBD and SQL Server 2008 (R2)

Thanks so much everyone. We have installed FreeTDS. I can execute, at the command line:
tsql -S ODBC -U myDatabaseName
I get prompted for a username and password, and can log in and execute commands against the database. So I know I can connect.
What I can't find in the documentation is WHERE DBI looks for its available_drivers. For example, I should expect that FreeTDS would show up in my DBI->avialable_drivers() call...but it doesn't.
We keep updating the configuration in /etc/odbc.ini; now it looks like we need to update /usr/local/etc/freeTDS.conf.
We will keep looking.
Many thanks for your kind help.
Emily

Replies are listed 'Best First'.
Re^3: Perl, DBD and SQL Server 2008 (R2)
by mje (Curate) on Feb 04, 2011 at 15:19 UTC

    DBI's available_drivers only lists available DBDs e.g., DBD::ODBC, DBD::Pg (the DBDs installed on your machine not ODBC drivers). If you are using DBD::ODBC the DBI method data_sources returns valid ODBC data sources (which I think you are looking for) and this info comes from the ODBC Driver manager and the SQLDataSources ODBC call. This is usually a list of data sources in one or more odbc.ini files. The odbcinst.ini file (if using unixODBC) lists available ODBC drivers on your machine - see the links I gave before - they explain all this.

      I use freetds/unixodbc on a hp-ux platform. I find perl scripts looks in the user home directory (~) for a .odbc.ini file. So, as the user that is executing the script, check ~/.odbc.ini to make sure its there. Hope this helps!