PDA

Click to See Complete Forum and Search --> : Best SQL Server 7 connection string ?


IClarke
Feb 6th, 2001, 04:33 AM
Can someone recommend the best connection sring to use when setting up a (read and write) connection to a SQL Server 7 database via ASP.

Cheers
Ian.

Jerry Grant
Feb 6th, 2001, 05:43 AM
I use the following:

DB_CONNECTIONSTRING = "Driver={SQL Server};Server=TB2K;Uid=KeyfaxUser;Pwd=******;Database=Keyfax;"

Whether or not it's the BEST way is open to speculation. I too would like to see other answers.

IClarke
Feb 6th, 2001, 05:47 AM
Thanks Jerry, looks good to me ...

Ian.

Feb 6th, 2001, 05:47 AM
That's what I use. :D

You can usually get away with leaving out the DATABASE argument if you are using the default database for that user.
You can also omit the UID/USER and PWS/PASS arguments if you give the web server user (IUSR_TB2K in Jerry's case) permissions to use the necessary db. :)

Clunietp
Feb 6th, 2001, 06:35 PM
The most efficient method is to use the native OLEDB provider

Provider=SQLOLEDB;Data Source=Server;Uid=KeyfaxUser;Pwd=******;Database=Keyfax;

If you use Driver={SQL Server}, then OLEDB must go through ODBC, which adds another layer for commands and data to pass through. The system must also look for that driver in the file system and parse it (in the case of File DSNs)

More layers = less speed

davidrobin
Feb 12th, 2001, 05:37 AM
If you are using SQLOLEDB as the provider then the parameters must be "User ID" and "Password".

The "UID" and "PWD" parameters are for use with the ODBC provider.

This came from article Q247931 of microsoft knowledge base