Solved

Connecting to MS SQL with Perl

Posted on 2001-06-20
8
250 Views
Last Modified: 2010-03-05
Can someone please tell me how I can connect to a remote
MS SQL server using Perl. I have DBI-1.15 and tried using
DBD-ODBC but it said I need to set some ODBCHOME environment variable or something. It seems I need to install something else too. Can someone lead me in the right direction? Or is there a way of connecting to a remote MS SQL server using some Unix client.

Thanks
Ashish
0
Comment
Question by:proftpd
8 Comments
 
LVL 4

Accepted Solution

by:
dda earned 15 total points
ID: 6211975
Look here:

http://www.freetds.org/

And use DBD::Sybase driver for connecting to MS SQL server. It works.
0
 
LVL 10

Expert Comment

by:makerp
ID: 6213226
i use DBD::ODBC and it worked fine, be sure to pass a username and password and create a DSN in control panel for the datasource, when creating it you can test it, if this fails then its a problem with the client or server
0
 

Author Comment

by:proftpd
ID: 6217048
Thanks all - will get back to you if I face further problems.

Ashish
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 10

Expert Comment

by:makerp
ID: 6217489
did you get connected ?
0
 
LVL 2

Expert Comment

by:hawkers
ID: 6217767
Profpd

I believe you can use the DBI module in two methods.

a) You can use your ODBC tool by setting an Ms SQL Server session DSN using the database username and password to login, or using the username and password details if your are using Win NT or Win 2000.

When setting up the ODBC Ms SQL connection try running a test to see if you are able to make a connection.

Or

b) Try using the ADO method, similiar to ASP or JSP.
e.g. DBI::ADO. I think the remaining DBI code is require such a connecting to a database handle and statement handles.

ADO method aviods establishing any connection through ODBC
0
 
LVL 16

Expert Comment

by:maneshr
ID: 6967728
All,

This question seems to be abandoned. As part of the ongoing cleanup effort, I will leave a note in
the Community Support topic area which will recommend to the Moderators that they close this question.

My recommendation will be to split the points equally makerp & dda.

PLEASE DO NOT AWARD THE POINTS TO ME.

Experts ===>: please leave your thoughts here. <====

maneshr
(NOT a moderator at EE)
0
 
LVL 2

Expert Comment

by:hawkers
ID: 6969178
proftpd, maneshr, experts and Moderators

Sounds fine by me!

hawkers
0
 
LVL 5

Expert Comment

by:Netminder
ID: 6984740
Per recommendation, force-accepted by
Netminder
CS Moderator

makerp: points for you at http://www.experts-exchange.com/perl/Q.20296037.html
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Perl script to parse xml file 2 111
Perl efficient DB Call 8 87
Regular Expression question to filter with negation. 6 95
Writing a parser for java language 4 78
On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question