Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Connecting to MS SQL with Perl

Posted on 2001-06-20
8
Medium Priority
?
267 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 60 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
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…
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

877 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