View Single Post

   
  #4 (permalink)  
Old 02-29-2008, 06:33 AM
Damien
 
Posts: n/a
Default Re: Connecting to SQL Server from ASP

Okay, the two ways I have used to connect from plain old ASP are:

1) Save a System (not User) DSN, and then set the connection string
just as:

cncString = "DSN=SqlConnect"

(if SqlConnect is the name of the DSN)

or,

2) Construct the whole connection within the ASP (dont touch ODBC at
all) such as:

cncString = "Provider=sqloledb;Data Source=" & myServer & ";Initial
Catalog=" & myDatabase & ";"

then add on either:

cncString = cncString & "Integrated Security=SSPI;"

or

cncString = cncString & "uid=" & myUser & ";pwd=" & myPassword & ";"

depending upon whether I'm using windows authentication or sql
authentication.

-------------------------------

May as well piggy back my own query on here, since it may turn out to
be relevant to OP:

We've recently been setting up an intranet site where we wanted to ID
the users from the browser using Windows Auth and then connect to the
DB as them using Windows Auth. Is there *still* no way of achieving
this when IIS/SQL are on different boxes? Any patches we may be
missing? We've switched to doing the browser authentication using basic
digest, but that isn't ideal. Windows/SQL are both 2000 with latest
stable SPs.

Reply With Quote