Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Staying connected with SQL?

Status
Not open for further replies.

luckydexte

Programmer
Apr 26, 2001
84
US
Hello All,

My perl scripts are being run on a Windows 2000 server and are connecting to another machine running Microsoft's SQL. My programs work fine using the Perl DBI/DBD module. However, each perl script needs to re-connect to the SQL database. Is there anyway to pass the connection between programs on an Internet application? Thanks.

Cheers,

Brandon
 
Hi,

There should be no problem in connecting to a remote MSSQL server from a local web app using a perl cgi-bin script. Where you would usually use localhost as the server, this should be replaced with the IP address of the remote MSSQL server. Also, you should include the port number that the MSSQL server listen to as a part of the connection string. Otherwise, everything should work as it customarily would. If the MSSQL existed on a computer with an IP address that is registerred with the interNIC, then you could use the ULR as the server (e.g. server=" This would also be true for a remote MySQL server, as many ISP use a computer dedicated solely to MySQL to give folks speedy access to their MySQL databases from the localhost on which the web site exits.
Leland F. Jackson, CPA
Software - Master (TM)
Nothing Runs Like the Fox
 
Brandon, I don't think you can "pass" the database connection from one script to another, but there are at least a few ways to achive a persistant database connection with cgi scripts - are your scripts cgi scripts? Now that I say that, I was referring to the Apache webserver - for the Apache webserver you can use modules like mod_perl and Apache::DBI for persistant db connections. If you're using a different webserver, my guess is you'll have to look for modules written for that webserver.

HTH. Hardy Merrill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top