On Fri, Jul 30, 2010 at 11:12 PM, Andrew Farnsworth <[email protected]>wrote:

> Ok, one last question.. what perl module are you using to connect to SQL
> server?
>
> Andy


This is sounding like a breakdown somewhere between unixODBC and DBI:ODBC.
 unixODBC tool can connect.  FreeTDS tool can connect.  Perl is having
problems.

I haven't seen instructions anywhere to tell DBI::ODBC about
unixODBC/FreeTDS...?

DBD::ODBC version 1.23
unixODBC version 2.2.12 - not current but not terribly ancient either

DBI->available_drivers
CSV, DBM, ExampleP, File, Gofer, ODBC, Oracle, Proxy, SQLite, Sponge

odbcinst -q -d
[FreeTDS]

/etc/unixODBC/odbc.ini contains system DSN's I created
/etc/unixODBC/odbcinst.ini contains FreeTDS driver info
/etc/unixODBC/ODBCDataSources/  - empty directory (???)

DBI->data_sources('ODBC') - none returned

<sigh>

export ODBCINI=/etc/unixODBC/odbc.ini
now
DBI->data_sources('ODBC')  => the data sources I set up...

but still

use DBI;
use DBD::ODBC;
my $dbh = DBI->connect('DBI:ODBC:mydsn', myuser, mypwd) or die $DBI::errstr;

[iODBC][Driver Manager]Specified driver could not be loaded (SQL-IM003)
[state was IM003 now 00000]
[iODBC][Driver Manager]FreeTDS: cannot open shared object file: No such file
or directory (SQL-00000)

Trying connect specifying the driver, server, etc. produces the same error
messages.


Okay, there must be another environment variable to point it to
/etc/unixODBC/odbcinst.ini (and ODBCSYSINI doesn't work) but

ln -s /etc/unixODBC/odbcinst.ini /etc/odbcinst.ini

Finally connects! (Specifying the driver, etc., not the DSN...  even though
it just listed them as available; now "[FreeTDS][SQL Server]Unable to
connect to data source. (SQL-08001))

Specifying the driver, etc. I still need a parameter to pass specifying what
database to connect to...  I thought it was DSN=, but that isn't it.

Paul

-- 
You received this message because you are subscribed to the Google Groups 
"NLUG" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nlug-talk?hl=en

Reply via email to