Re: [dbi] DSN's and DRIVER attribute
- From: martin.evans@xxxxxxxxxxxx (Martin J. Evans)
- Date: Fri, 03 Jun 2005 07:06:14 +0100
Sharon,
The odbcinst.ini file should contain an entry like:
[FreeTDS] Description = FreeTDS Driver = /usr/local/freetds/lib/libtdsodbc.so DontDLClose = 1
assuming you were using FreeTDS which was just a guess on my part. You need to find where your ODBC driver shared object is installed i.e. libtdsodbc.so or whatever the driver is.
Perhaps I need to review the tutorial I pointed you at. What happens when you refer to DSN=mydsn is unixODBC looks up [mydsn] in the odbc.ini file where it finds a Driver=FreeTDS. unixODBC then looks up [FreeTDS] entry in odbcinst.ini where it gets a Driver=/path_to_driver then it loads the shared object pointed to.
Martin
Smith, Sharon Michelle (OSLO) wrote:
Thanks Martin, Dan...
That would definitely explain the DSN problem I was having and makes a
lot of sense. It fixed all my DSN not found errors. However, I'm still
having difficulty pointing the odbc.ini file to the correct driver with
the DRIVER attribute. Mostly, I don't know where it got installed or
what it's called. Easysoft's documentation says something about
unixODBC talking to odbcinst.ini for this. I've tried pointing it to
the odbcinst.ini file and even just the directory that holds that file,
but I keep receiving that error: "Can't open lib path/to/odbcinst.ini"
I'm definitely doing something wrong. I thought it was supposed to be
pointing to a '.so' type file. Can anyone help me?
(Clarification for anyone who's seeing this for the first time, I'm trying to get my connectivity tests working for a DBD::ODBC driver module I've installed on a Linux environment.)
Thanks for any info...
~Sharon
-----Original Message-----
From: Dan Scott [mailto:denials@xxxxxxxxx] Sent: Thursday, June 02, 2005 5:00 AM
To: dbi-users@xxxxxxxx
Subject: Re: [dbi] DSN's
For the DSN-less connections, see http://www.connectionstrings.com -- great resource.
Dan
On 6/2/05, Martin J. Evans <martin.evans@xxxxxxxxxxxx> wrote:
Sharon,
The string after "ODBC:" is usually a DSN name as in:
DBI->connect("dbi:ODBC:mydsn",...)
or
DBI->connect("dbi:ODBC:DSN=mydsn")
where mydsn is an entry in your unixODBC odbc.ini file defining host, port, dbname e.g.
[mydsn] driver = freetds host = something.something.something port = 1521 dbname = name
If you want to use DSN-less connections then you'll need to start with
DRIVER=freetds or whatever. Note, you should have a freetds entry in odbcinst.ini also.
You can find your user and system odbc.ini files with odbcinst -j.
Perhaps
http://www.easysoft.com/products/9999/documentation/perl_tutorials/dbd _odbc_tuto rial1.html
and
http://www.easysoft.com/products/9999/documentation/perl_tutorials/dbd _odbc_tuto rial3.html
might help explain as they contain alot about unixODBC, DSNs etc.
Martin
On 01-Jun-2005 Smith, Sharon Michelle (OSLO) wrote:
Hi,
I'm trying to debug an install for my DBD::ODBC module, and since this is my first experiment with the DBI, I have a question on format/syntax. But first, here's some background info that may/not help:
Environment is Linux
I've already installed/tested Perl5, DBI, unixODBC (manager) Now, I'm trying to install the ODBC driver
In order to install the ODBC driver, environment variables: DBI_DSN,
DBI_USER, DBI_PASS, ODBCHOME, LD_LIBRARY_PATH, and LANG all had to be added to .bashrc
I'm installing the DBD::ODBC module from CPAN. It comes with a series of connectivity tests that you can run after running 'make' by doing 'make test'. I'm trying to narrow down my list of things that could be wrong. Almost all of the errors seem to be complaining about my 'DSN not found or my driver not specified'. Can someone tell me if the following syntax is ok or if any other major no-no's jump out at you?
export DBI_DSN='dbi:ODBC:host=something.something.something;port=1521;dbnam
e=na
me'
I'm very new to all this and would appreciate as much detailed help as possible. Thanks for any info....
-- Martin J. Evans Easysoft Ltd, UK Development
.
- References:
- RE: [dbi] DSN's and DRIVER attribute
- From: Sharon Michelle Smith
- RE: [dbi] DSN's and DRIVER attribute
- Prev by Date: RE: [dbi] DSN's and DRIVER attribute
- Next by Date: DBD::Proxy and FetchHashKeyName
- Previous by thread: RE: [dbi] DSN's and DRIVER attribute
- Next by thread: DBD::Proxy and FetchHashKeyName
- Index(es):
Relevant Pages
|