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

how do i login to SQL !!!!!

Status
Not open for further replies.

alonak

Programmer
Mar 4, 2003
8
IL
in my asp file there is a conection to sql server

set c=server.createobject("adodb.connection")
c.open "dsn="MyDsn";"

i have a problem to login to the sql !!!
how the line is going to add user & password
how do i edit : c.open "dsn="MyDsn";" ?????
thanks a lot .
 
I would do something like this:
dim connStr, conn

connStr = "Provider=sqloledb;" & _
"Data Source=YourDataSource;" & _
"Initial Catalog=DatabaseName;" & _
"UID=DatabaseLogin;" & _
"PWD=DatabasePassword;"

Set conn = Server.CreateObject("ADODB.Connection")
conn.ConnectionString = connStr
conn.open

Then later use:

set rs = conn.execute(yourSQLstatement)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top