Hello esteemed monks, and thanks ahead of time.
We are writing a secure web site in Java on an Ubuntu installation on a linux box that communicates with a MS SQL server (2008 R2) on a Microsoft box. The web site works fine. I now need to pull data from the web site and format it in HL7, and I want to use my beloved Perl. Problem is, I am having a lot of trouble getting Perl to see the DBD installation. (DBI is fine.)
I have tried downloading and installing DBD::ODBC as well as FreeTDS (because I am not thrilled about spending tons of money at Easysoft for their stuff, because I have always downloaded the drivers from CPAN for free).
I am hurting here. I run a bash shell under Debian (Ubuntu) and have set my LD_LIBRARY_PATH to library location: /usr/lib/odbc. I have manually updated the odbc.ini file there with the usual info (host server, database, etc.). Regardless of what I do, a DBI->connect tells me I have not specified the a driver. Here is my current perl code:
I have tried a full path to the driver:
#my($driver) = "/usr/lib/libiodbc.so";
...hard-coding the driver name
my($driver) = "ODBC";
...trying "Proxy" just for grins, as in:
my($driver) = "Proxy"
(DBI->available_drivers tells me it can see both ODBC and Proxy)
The rest of my script reads as:
my($host) = "<my IP address>";
my($db) = "myDb\@$host";
my($port) = 1433;
my($dsn) = "dbi:$driver:database=$db;port=$port"
my($dbh) = DBI->connect("dbi:ODBC:$db;$port", "me", "mypassword") ||
+die(DBI->errstr);
..and I get, regardless:
[dbi:ODBC:database=myDB@oag7.oag.local:1433]
DBI connect('myDB@host;1433','me','myPassword') failed: [iODBC][Driver
+ Manager]Data source name not found and no default driver specified.
+Driver could not be loaded (SQL-IM002) at ./sqlTest.pl line 30
[iODBC][Driver Manager]Data source name not found and no default drive
+r specified. Driver could not be loaded (SQL-IM002) at ./sqlTest.pl l
+ine 30.
";
Suggestions? Thanks!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.