CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: DBI: Re: [bulrush] How to use DBI with MSSQL server?: Edit Log



bulrush
User

Jul 1, 2015, 11:27 AM


Views: 13350
Re: [bulrush] How to use DBI with MSSQL server?

/etc/odbc.ini:

Code
[ODBC Data Sources] 
ResponseBDO = Response database desc in /etc/odbc/ini

[ResponseBDO]
Driver = /usr/lib/odbc/virtodbc.so
Description = Response MSSQL ODBC driver
SERVER = 12.19.1.9
PORT =
USER = myuser
Password =
Database = dbname

[Default]
Driver = /usr/lib/virtodbc.so
Description = Default ODBC driver
SERVER = 12.19.1.9
USER = myuser
Database = test


Perl command that gets error below:

Code
$respdsn="dbi:ODBC:DSN=ResponseBDO;host=$respserver"; 
$respdbh=DBI->connect($respdsn, $respdbuser, $respdbpw,
{AutoCommit=>0,RaiseError=>1,PrintError=>0}
);


When I run the Perl program I get this error:

Code
DBI connect('DSN=ResponseBDO','myuser',...) failed: 
[unixODBC][OpenLink][Virtuoso iODBC Driver]CL033:
Connect failed to localhost:1111 = localhost:1111. (SQL-S2801) at
/home/chuck/perl/progs/fedex.pl line 1532.
at /usr/lib/perl5/DBI.pm line 684.


When I run 'odbcinst -q -d' I get:

Code
chuck@ubuntucomp:~/perl/gilson/jimv/fedex$ odbcinst -q -d 
odbcinst: SQLGetPrivateProfileString failed with .



Why is the driver trying to talk to localhost:1111?
-----


(This post was edited by bulrush on Jul 6, 2015, 4:03 AM)


Edit Log:
Post edited by bulrush (User) on Jul 6, 2015, 4:03 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives