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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DSN-Less MSSQL connection string needed

Status
Not open for further replies.

MikeBronner

Programmer
May 9, 2001
756
US
Hi there,

What I am looking for is pretty specific: a dsn-less connection string to a mssql database. I have all ther pertinent information, however, I can't get it to work. For hypothetical purposes, I am using the following information:

Driver: SQL Server
Server: mssql.host.com
Database: TestDB
User: MyUser
Password: MyPass

What I'm using right now looks like this:

$dsn = 'driver=SQL Server;server=mssql.host.com;database=TestDB;uid=MyUser;pwd=MyPass;';
$dbh = DBI->connect("dbi:ODBC:$dsn") or die DBI->errstr;

However, when I execute this, I get a 'silent' failure; the scripts stops without any error message and worst of all without connecting. Can anyone point out what I am doing wrong?

Thanks! Take Care,
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top