Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: changing database with DBI and DBD-ODBC

by runrig (Abbot)
on Sep 24, 2012 at 20:27 UTC ( #995438=note: print w/replies, xml ) Need Help??

in reply to changing database with DBI and DBD-ODBC

Another way is to create a 'File DSN' as a starting template. Join all the lines with ";" instead of newlines and use that as the DBI DSN. Find where the database is specified in the string, and change that as desired.
  • Comment on Re: changing database with DBI and DBD-ODBC

Replies are listed 'Best First'.
Re^2: changing database with DBI and DBD-ODBC
by mje (Curate) on Sep 24, 2012 at 20:47 UTC

    As I'm sure runrig knows there are 3 basic ways to connect via ODBC. DSN=yourdsn, FILEDSN=a_file_with_Attributes and so called DSN-less connection with DRIVER=xxx. On Windows you can also add odbc_driver_complete which may throw a dialogue (if you have a window handle) to complete the connection attributes via a dialogue (you might use this to prompt for username/password etc)

    One really useful thing is odbc_out_connect_string which you can use after any successful connect to find out the connection string you can use to connect to this data source again in the future. This is typically what MS Access (and other apps) use to store a connection string after you've filled in a dialog to connect to an ODBC driver.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://995438]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2018-06-22 19:45 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (124 votes). Check out past polls.