Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Need Help for connecting MSSQL SERVER From Linux(ubuntu)

by perlraj (Acolyte)
on Sep 17, 2012 at 06:43 UTC ( #993978=perlquestion: print w/ replies, xml ) Need Help??
perlraj has asked for the wisdom of the Perl Monks concerning the following question:

I just installed the ODBC driver in the Ubuntu, but still I am facing issues while connecting the database from Perl. Here is the description on what I have done in my machine.

I installed the MSSQL Driver and Unix ODBC from easysoft website. The path details in my machine follows:

ODBC Installed Path:- user/local/easysoft/unixodbc

Data Source and Driver path: user/local/etc Sample Code:

#!/usr/bin/perl use strict; use DBI; my $dsn="DBI:ODBC:DRIVER={SQL Server};Server=xxx.xxx.xxx.xxx,1433;data +base=DB_name"; my $dbh = DBI->connect($dsn, "username", "password" ,{AutoCommit => 1} +) or die $DBI::errstr;

Error: DBI connect('DRIVER={SQL Server};Server=xxx.xxx.xxx.xxx,1433;database=DB_name','username',...) failed: unixODBCDriver Manager Can't open lib 'SQL Server' : file not found (SQL-01000) at sample.pl line 5 unixODBCDriver ManagerCan't open lib 'SQL Server' : file not found (SQL-01000) at sample.pl line 5. Title: Need help in connecting MSSQL database from Linux OS (Ubuntu)

Comment on Need Help for connecting MSSQL SERVER From Linux(ubuntu)
Download Code
Re: Need Help for connecting MSSQL SERVER drom Linux(ubuntu)
by McDarren (Abbot) on Sep 17, 2012 at 07:02 UTC

      Hi thanks a lot for your solution, but i have lot of scripts implemented using DBD::ODBC,so need to be done with DBD::ODBC.

      I have problem with creating and accessing datasouce.

      Thanks

      pushparaj

      Agreed. The ODBC driver works great for connecting to Microsoft SQL Server on Windows, but on Linux the Sybase driver seems a lot more reliable.

      perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
Crosspost!!!
by LanX (Canon) on Sep 17, 2012 at 09:04 UTC
Re: Need Help for connecting MSSQL SERVER From Linux(ubuntu)
by mje (Deacon) on Sep 17, 2012 at 09:46 UTC

    Your code is attempting to use the driver called "SQL Server" so you need a driver called that in your /etc/odbcinst.ini file. The Easysoft one is usually called "Easysoft ODBC-SQL Server" so check your odbcinst file and either change that to match your code or change your code to match the driver name.

      Hi thanks a lot, but i received this error:

      unixODBCEasysoftSQL Server DriverSQL ServerGeneral error: OS Version mismatch: Please report this sequence (AAAG, LX, 3, -1, -1) to Easysoft support at support@easysoft.com (SQL-HY000) and i have reported it to them

        Seems pretty explicit, did you report this as requested? A search engines shows similar problems on their knowledge base. Have you check there?

        You need a version which supports Linux kernel 3 (I'd guess). Mail support@easysoft.com and they can sort you out.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://993978]
Approved by McDarren
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2014-09-19 04:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (129 votes), past polls