Fwd: Re: Phoenix.pm: PERL-SQL question

Doug and Julie Miles djmilesfamily at earthlink.net
Wed Jan 30 17:21:03 CST 2002


>X-Authentication-Warning: mail.pm.org: majordomo set sender to 
>owner-phoenix-pm-list at pm.org using -f
>Date: Wed, 30 Jan 2002 11:34:24 -0700
>From: doug.miles at bpxinternet.com (Doug Miles)
>Organization: Bowne of Phoenix
>User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.7) Gecko/20011226
>X-Accept-Language: en-us
>To: phoenix-pm-list at happyfunball.pm.org
>Subject: Re: Phoenix.pm: PERL-SQL question
>Sender: owner-phoenix-pm-list at pm.org
>Reply-To: phoenix-pm-list at happyfunball.pm.org
>
>N wrote:
>
>>I have file on a unix server and need the
>>info(actually it is the same file I am having troubles
>>with now) loaded to a MSSQL database on an NT machine
>>and was wondering if there was a way I could make a
>>database connection from the UNIX server to the NT
>>database through perl rather than writing an ftp
>>function to send the file over and then an NT perl db
>>loader picking it up and then inserting the values in
>>the database.
>>Rgds
>>N
>
>DBI/DBD::ODBC should do what you want.  Anyone out there have experience 
>with this?

Here is a list of FAQs from the DBD::ODBC man page that may help:

What is DBD::ODBC? Why can't I connect? Do I need an ODBC driver? What is 
the ODBC driver manager?
These, general questions lead to needing definitions.

1) ODBC Driver - the driver that the ODBC manager uses to connect and 
interact with the RDBMS. You DEFINITELY need this to connect to any 
database. For Win32, they are plentiful and installed with many 
applications. For Linux/Unix, some hunting is required, but you may find 
something useful at:

         http://www.openlinksw.com
         http://www.easysoft.com
         http://www.intersolv.com



2) ODBC Driver Manager - the piece of software which interacts with the 
drivers for the application. It "hides" some of the differences between the 
drivers (i.e. if a function call is not supported by a driver, it 'hides' 
that and informs the application that the call is not supported. DBD::ODBC 
needs this to talk to drivers. Under Win32, it is built in to the OS. Under 
Unix/Linux, in most cases, you will want to use freeODBC, unixODBC or 
iODBC. iODBC was bundled with DBD::ODBC, but you will need to find one 
which suits your needs. Please see www.openlinksw.com, www.easysoft.com or 
www.iodbc.org

3) DBD::ODBC. DBD::ODBC uses the driver manager to talk to the ODBC 
driver(s) on your system. You need both a driver manager and driver 
installed and tested before working with DBD::ODBC. You need to have a DSN 
(see below) configured *and* TESTED before being able to test DBD::ODBC.

4) DSN -- Data Source Name. It's a way of referring to a particular 
database by any name you wish. The name itself can be configured to hide 
the gory details of which type of driver you need and the connection 
information you need to provide. For example, for some databases, you need 
to provide a TCP address and port. You can configure the DSN to have use 
information when you refer to the DSN.

Where do I get an ODBC driver manager for Unix/Linux?
DBD::ODBC comes with one (iODBC). In the DBD::ODBC source release is a 
directory named iodbcsrc. There are others. UnixODBC, FreeODBC and some of 
the drivers will come with one of these managers. For example Openlink's 
drivers (see below) come with the iODBC driver manager. Easysoft supplies 
both ODBC-ODBC bridge software and unixODBC.

How do I access a MS SQL Server database from Linux?
Try using drivers from http://www.openlinksw.com or www.easysoft.com The 
multi-tier drivers have been tested with Linux and Redhat 5.1.

How do I access an MS-Access database from Linux?
I believe you can use the multi-tier drivers from 
http://www.openlinksw.com, however, I have not tested this. Also, I believe 
there is a commercial solution from http://www.easysoft.com. I have not 
tested this.

If someone does have more information, please, please send it to me and I 
will put it in this FAQ.

Almost all of my tests for DBD::ODBC fail. They complain about not being 
able to connect or the DSN is not found.
Please, please test your configuration of ODBC and driver before trying to 
test DBD::ODBC. Most of the time, this stems from the fact that the DSN (or 
ODBC) is not configured properly. iODBC comes with a odbctest program. 
Please use it to verify connectivity.

For Unix -> Windows DB see Tom Lowery's write-up.
http://tlowery.hypermart.net/perl_dbi_dbd_faq.html#HowDoIAccessMSWindowsDB






More information about the Phoenix-pm mailing list