Connecting to Oracle with DBI using DBD::ODBC

I set up a system dsn on windows 2000 called Module_Ack.  I am trying to connect via ODBC to an Oracle 8i database that is on another server on the network.  My connect statement is the following:

use DBI;
$dbh = DBI->connect('dbi:ODBC:Module_Ack', 'username', 'password');

When I run the script I get the following error.

connect(Module_Ack) failed: Specified driver could not be loaded due to system error 126 (Oracle73 Ver 2.5). (SQL-IM003)(DBD: db_login/SQLConnect err=-1) at C:\Inetpub\wwwroot\testrisk\cgi-bin\CompModuleAck.pl line 372 ="0">

CompModuleAck.pl line 372 is the line of the connect statement above.  Any Ideas?

Thanks,

Brian
bjburkeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

 
BigJoe1008Commented:
If you are using Activestate perl just use DBD::Oracle.  It is very simple to do.

You may need to use the Oracle 8.1.7 driver for windows (By Oracle) Microsofts driver has issues sometimes.

Try to connect in the DSN manager tool.  Make sure that works.  
0
 
bjburkeAuthor Commented:
I tried using DBD::Oracle but I get this error:

Can't load 'C:/Perl/site/lib/auto/DBD/Oracle/Oracle.dll' for module DBD::Oracle: load_file:The specified module could not be found at C:/Perl/lib/DynaLoader.pm line 206.

I looked in the path C:/Perl/site/lib/auto/DBD/Oracle/Oracle.dll and the Oracle.dll file is there, so I don't know why it can't load it.

I'm using the following code to connect.

use DBI;
use DBD:Oracle;

$ENV{'ORACLE_HOME'} =   'C:\ORANT\BIN';

$dbh = DBI->connect('dbi:Oracle:dms_d', 'username', 'password')

dms_d is the alias that is in my tnsnames.ora file.
0
 
BigJoe1008Commented:
Did you install the Oracle client?  If so make sure you installed the Pro-C and SQLplus
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
BigJoe1008Commented:
Here is an example of how I connect to ODBC declared dbs on Winnt

#!/usr/bin/perl
use DBI;

my $dbh = DBI->connect("DBI:ADO:products")or die "Connecting : $DBI::errstr\n";

Here is for straight oracle.

#!/usr/bin/perl
use DBI;

my $dbh = DBI->connect("DBI:Oracle:host=bigserver;sid=database", 'username', 'password') or die "Connecting : $DBI::errstr\n";


Make sure you have Oracle 8+ client installed.  It may be an issue if you are running Oracle 7.X
0
 
bjburkeAuthor Commented:
I have the Oracle client and SQLplus installed.  I'm not sure what Pro-C is, but I don't have that installed.  Maybe the problem is I'm running Oracle client 7.X

I'll have to see if I can get my hands on 8+ client.  

It doesn't make sense that Perl can't load the Oracle.dll file even though the file exists in that directory.


0
 
BigJoe1008Commented:
From this error:
connect(Module_Ack) failed: Specified driver could not be loaded due to system error 126 (Oracle73 Ver
2.5). (SQL-IM003)(DBD: db_login/SQLConnect err=-1) at C:\Inetpub\wwwroot\testrisk\cgi-bin\CompModuleAck.pl
line 372 ="0">

it shows it is trying to access something that is in the Oracle 8 client that isn't in 7.

0

Experts Exchange Solution brought to you by ConnectWise

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
 
BigJoe1008Commented:
Oracle should have a free download.

0
 
inq123Commented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept a comment by BigJoe1008

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

inq123
EE Cleanup Volunteer
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.