Groups | Blog | Home
all groups > sql server odbc > october 2003 >

sql server odbc : Connecting to SQL Server



Laurent
10/23/2003 7:38:08 AM
I have a website which uses a SQL Server database (version
7 I think).

I have two database files a 'mdf' and a 'ldf'.

This is the asp code that connects to it
---
Application("Conn_ConnectionString") = "DSN=km" 'local
sql = "SELECT * FROM AdminUser"
set rsPass = server.CreateObject("adodb.recordset")
rsPass.Open sql, Application("Conn_ConnectionString")
---
I have only ever used MS Access databases in the past so im
not sure where to start.

What software do I need to install?
How do I setup the DSN connection - Is it the same as MS
Brannon Jones [MS]
10/23/2003 5:49:38 PM
One big difference between SQL and Access is that SQL requires you to login
with a username and password.

So, at the very least, your connection string needs to have the following
properties added to it: UID= and PWD=.

The actual database files (the .mdf and .ldf) are not really important, as
you are connecting to a server, and not the file itself (unlike Access).

You should get the proper username and password to use from your database
administrator.

Brannon

[quoted text, click to view]

AddThis Social Bookmark Button