BeneSphinx has asked for the wisdom of the Perl Monks concerning the following question:
I have a DSN that correctly works with DBI and DBD::ODBC to connect to a MSSQL server from a Windows machine. However, I can't figure out how to use a database other than the DSN's default database.
Whenever I try specifying the database in the ODBC connection string, it seems to invalidate the whole string ("Data source name not found and no default driver specified"). The DSN that does work for me is simpler, just "dbi:ODBC:mydsn", but this uses the default database.
I'm wondering if you know any way to specify a different database, either at the time of connection (in the connection string), or later with a command. Nothing in the docs seems to match this. Thanks in advance for your help!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: changing database with DBI and DBD-ODBC
by roboticus (Chancellor) on Sep 24, 2012 at 19:52 UTC | |
by BeneSphinx (Sexton) on Sep 24, 2012 at 20:14 UTC | |
Re: changing database with DBI and DBD-ODBC
by mje (Curate) on Sep 24, 2012 at 20:25 UTC | |
Re: changing database with DBI and DBD-ODBC
by runrig (Abbot) on Sep 24, 2012 at 20:27 UTC | |
by mje (Curate) on Sep 24, 2012 at 20:47 UTC |