Solved

Connecting to MS SQL with Perl

Posted on 2001-06-20
8
254 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
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…
Six Sigma Control Plans

690 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