Hi Tee,
Well, Though there are a lot of such discussions over the performance on using the connection string, I would suggest you, stick with OLEDB standard connection string, as it is the native provider.
OLEDB - commonly used standard connection string.
"Provider=sqloledb;Data Source=Aron1;Initial Catalog=pubs;User Id=sa;Password=asdasd;"
Then your code would be ...
Code:
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.ConnectionString = "Provider=sqloledb;Data Source=YOUR_SERVERNAME;Initial Catalog=YOUR_DATABASENAME;User Id=YOUR_SQL_USERNAME;Password=YOUR_PASSWORD;"
Conn.Open
'Now the connection to your sql server is made to executing
the sql statement that you construct at the later part of this code.
Replace all the entries in the connection string posted above, that are prefixed with YOUR_
with the values that apply to your sql server.
Also take a look at this article, that would shed some light on Connection string.
DSN, DSN-Less or OLEDB?
What's in an ADO Connection String?
Miscellaneous tips for improving ASP performance and robustness
Quote from another site.
Quote:
quote:Why to use DSN Connections ?
* Provides easy to remember data source names.
* When there are lots of data sources to think of and you want a central repository to hold the collection
of data sources without having to worry about the actual site and configuration of the data sources.
Why to use DSN less Connections ?
* When you can't register DSNs yourself e.g. when you are running a virtual hosting account on other's server.
Stop emailing system administrator for Creating/Editing DSNs on the hosting server, but can connect to your databases directly.
* Provides faster database access because it uses native OLE DB providers, while DSN connections make use of ODBC drivers.
|
Hope this helps.
Cheers!
_________________________
- Vijay G
Strive for Perfection