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: [FishMonger] How to use DBI with MSSQL server?: Edit Log



bulrush
User

Jul 1, 2015, 10:29 AM


Views: 13396
Re: [FishMonger] How to use DBI with MSSQL server?

Ok. I installed unixodbc, unixodbc-dev, libodbc1, libtool, autotools-dev and several other packages that comes with unixodbc. I don't use ODBC much so I'm a newbie, and the Perl syntax for DBI::ODBC is:


Code
$dbh = DBI->connect('dbi:ODBC:DSN=mydsn', 'user', 'password');


I vaguely remember what a DSN is, I think it's a file with info for ODBC. But how do I make a DSN on Ubuntu 14.04?

EDIT: I found a dir /etc/ODBCDataSources but there is no odbc.ini in it. Do I have to make the odbc.ini myself? I found this helpful but it does not mention installing an MSSQL odbc library driver: https://help.ubuntu.com/community/ODBC

Found these files but none look like they belong to MSSQL.

Code
chuck@ubuntucomp:/etc/ODBCDataSources$ ls -l /usr/lib/odbc 
total 2288
-rw-r--r-- 1 root root 567536 Sep 24 2013 virtodbc_r.so
-rw-r--r-- 1 root root 559216 Sep 24 2013 virtodbc.so
-rw-r--r-- 1 root root 609104 Sep 24 2013 virtodbcu_r.so
-rw-r--r-- 1 root root 600784 Sep 24 2013 virtodbcu.so


In my DSN do I point to virtodbc.so?
-----


(This post was edited by bulrush on Jul 1, 2015, 10:43 AM)


Edit Log:
Post edited by bulrush (User) on Jul 1, 2015, 10:40 AM
Post edited by bulrush (User) on Jul 1, 2015, 10:43 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