Clapper SQLCMD is a Python application that uses '/usr/local/lib/libmyodbc3.so'.

I think what it's boiling down to is that there is no ODBC driver on this Mac 
and I will have to purchase one.

Thanks,
Dave

From: Jonathan Leffler [mailto:jonathan.leff...@gmail.com]
Sent: Tuesday, May 03, 2011 2:09 PM
To: Stiff, David
Cc: dbi-users@perl.org
Subject: Re: (Fwd) Perl DBI on Mac OS X


On Tue, May 3, 2011 at 10:53, 
<david_st...@mcafee.com<mailto:david_st...@mcafee.com>> wrote:
Comments in-line
Now you have to get down to - which ODBC drivers do you have installed?
>> How can I check?

I don't know.  The chances are that if you're using iODBC, it has a way to do 
that - maybe via the isql tool.


Do you need the FreeTDS driver, for example?
>> Probably not. Right now I am using 'sqlcmd' from Clapper Software. I may 
>> have installed FreeTDS when I was initially trying to get DB access working. 
>> However, I don't want to do anything that disables 'sqlcmd'.
So the Clapper SQLCMD program is able to connect?  Can you see the DSN 
(connection information) it is using?  If so, can you use that, or minor 
variations on that, to connect via other programs?

If you're using iODBC, the isql program should allow you to test connections.


What is the recommended course of action? Do I need to install/uninstall 
something? Or is it an ODBC configuration setting I need to change?

In my view (not by any means definitive since I've not actually done it for the 
setup you have), you should ensure that you can connect to the DBMS (DB) using 
just the ODBC software -- probably using isql or something similar.  Only when 
you have that ironed out should you try bringing Perl into the picture.

My general rule of thumb is:

* Get the DB connection working without Perl (+ DBI + DBD::WhatEver)
* Then get it working with Perl (+ DBI + DBD::WhatEver)

The DBD::Informix Makefile.PL enshrines that viewpoint - it compiles a test 
program to ensure that you have the software it needs and that you can connect 
to some test database before it creates the Makefile needed to build 
DBD::Informix.  It has saved me endless grief as we separate database 
connectivity issues in general from connectivity via Perl.  If you can't 
connect without Perl, there's no reason to think you'll be successful with 
Perl.  If you can connect without Perl, then the scope of the problems with 
Perl is generally simpler.


Good luck,
Jonathan


From: Jonathan Leffler 
[mailto:jonathan.leff...@gmail.com<mailto:jonathan.leff...@gmail.com>]
Sent: Tuesday, May 03, 2011 11:47 AM
To: Stiff, David
Cc: dbi-users@perl.org<mailto:dbi-users@perl.org>

Subject: Re: (Fwd) Perl DBI on Mac OS X


On Tue, May 3, 2011 at 08:15, 
<david_st...@mcafee.com<mailto:david_st...@mcafee.com>> wrote:
Sorry. I meant to say Leopard, not Ubuntu.

MacOS X it is, then...

I am running a test script that lists the drivers and then connects to list the 
tables. I get this:

$ perl testdbi.pl<http://testdbi.pl>

Driver: DBM
Driver: ExampleP
Driver: File
Driver: Gofer
Driver: ODBC
Driver: Proxy
Driver: Sponge

That says you've got the Perl + DBI + DBD::ODBC combination installed.  You 
even have an ODBC driver manager installed.

Now you have to get down to - which ODBC drivers do you have installed?

Do you need the FreeTDS driver, for example?


DBI connect('Driver={SQL 
Server};Server=database.domain.com<http://database.domain.com>;Database=MyDB','readonly',...)
 failed: [iODBC][Driver Manager]Specified driver could not be loaded 
(SQL-IM003) [state was IM003 now 00000]
[iODBC][Driver Manager]dlopen({SQL Server}, 6): image not found (SQL-00000) at 
testdbi.pl<http://testdbi.pl> line 14
Can't connect to DBI:ODBC:Driver={SQL 
Server};Server=database.domain.com<http://database.domain.com>;Database=MyDB: 
[iODBC][Driver Manager]Specified driver could not be loaded (SQL-IM003) [state 
was IM003 now 00000]
[iODBC][Driver Manager]dlopen({SQL Server}, 6): image not found (SQL-00000) at 
testdbi.pl<http://testdbi.pl> line 14.

Thanks,
David

From: Jonathan Leffler 
[mailto:jonathan.leff...@gmail.com<mailto:jonathan.leff...@gmail.com>]
Sent: Tuesday, May 03, 2011 10:27 AM
To: Stiff, David; dbi-users@perl.org<mailto:dbi-users@perl.org>
Subject: Re: (Fwd) Perl DBI on Mac OS X (or Ubuntu?)


On Mon, May 2, 2011 at 19:47, Tim Bunce 
<tim.bu...@pobox.com<mailto:tim.bu...@pobox.com>> wrote:
----- Forwarded message from 
david_st...@mcafee.com<mailto:david_st...@mcafee.com> -----

Date: Mon, 2 May 2011 18:40:11 -0700
From: david_st...@mcafee.com<mailto:david_st...@mcafee.com>
To: tim.bu...@pobox.com<mailto:tim.bu...@pobox.com>
Subject: Perl DBI on Mac OS X

  [...] I am new to Perl DBI. I have it working fine on my Windows 7 box.

  I have installed the module on Ubuntu and tried running the same test script 
but get a connection error:

Your subject line says 'MacOS X'; your comment here says 'Ubuntu'.  AFAIK, 
those are not synonyms.

Which platform are you actually having the problems on?

  DBI connect('Driver={SQL Server};Server=[dsn];Database=[db]','[pwd]',...) 
failed: [iODBC][Driver
  Manager]Specified driver could not be loaded (SQL-IM003) [state was IM003 now 
00000]

  [iODBC][Driver Manager]dlopen({SQL Server}, 6): image not found (SQL-00000) 
at testDBI.pl line 14

  Can't connect to DBI:ODBC:Driver={SQL Server};Server=[dsn];Database=[db]: 
[iODBC][Driver
  Manager]Specified driver could not be loaded (SQL-IM003) [state was IM003 now 
00000]

  [iODBC][Driver Manager]dlopen({SQL Server}, 6): image not found (SQL-00000) 
at testDBI.pl line 14.

  Do I need to install another module? Or configure ODBC?


Can you write a pure ODBC program that connects to your database?  If so, what 
DSN do you use to connect?
If not, concentrate on configuring ODBC correctly.  Do you have an ODBC driver 
for your DBMS installed?

Is your DBMS running on your Ubuntu (MacOS X) box or out on a Windows box?


--
Jonathan Leffler 
<jonathan.leff...@gmail.com<mailto:jonathan.leff...@gmail.com>>  #include 
<disclaimer.h>
Guardian of DBD::Informix - v2008.0513 - http://dbi.perl.org
"Blessed are we who can laugh at ourselves, for we shall never cease to be 
amused."

Reply via email to