Re: [dbi] DSN's and DRIVER attribute



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







.



Relevant Pages

  • Re: XP HOME BOOT FAILURE
    ... you remove the driver for the graphics card, ... >> If you run a repair install as I initially described, ... A repair install should bypass that but it will ... >>>> on, follow the screens. ...
    (microsoft.public.windowsxp.accessibility)
  • Problems with Touchpad,keyboard and USB after Ideacom update (solu
    ... and keyboard .I have made fresh install of XP Home and have all updated ... recomended update from Driver detective,that i use offten. ... allready and when i do this it knocks off my USB mouse leaving me not able to ... 2.Mutil-Access driver HCT driver verify crash fix! ...
    (microsoft.public.windowsxp.general)
  • Re: XP update loses sound card
    ... I assume you tried a forced install of a soundcard? ... should try the sound card driver from Toshiba ... The WINMM WDM Audio driver is out of the list now. ... The sound is enabled and uninstalling the Microsoft WINMM WDM Audio ...
    (microsoft.public.windowsupdate)
  • OT: What do you do with your old computers?
    ... connected that to the WLAN as well, using a small USB wireless link. ... And what about backups for petesp4 and Bigblack? ... Once it was talking to the network, I decided to install the printer and the ... driver, and was marked as an unknown device. ...
    (comp.lang.cobol)
  • Re: Modem Install Problems
    ... PCI: PCI BIOS revision 2.10 entry at 0xfb9c0, ... ACPI tables contain no PCI IRQ routing entries ... Serial driver version 5.05c with HUB-6 MANY_PORTS ... install: cannot stat `536ep.o': No such file or directory ...
    (comp.os.linux.setup)