Hi I have an asp page that connects to my access db.
I would like to use a dsn connection but I am running into a couple of problems
this is my original connection
This is what I am trying
I would like to use a dsn connection but I am running into a couple of problems
this is my original connection
Code:
Username = Request.Form("txtUsername")
Password = Request.Form("txtPassword")
'Build connection with database
set conn = server.CreateObject ("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath ("\mydb.mdb")
set rs = server.CreateObject ("ADODB.Recordset")
rs.Open "SELECT * FROM mydb where username='" & Session("Username")& "'", conn, 1
This is what I am trying
Code:
Username = Request.Form("txtUsername")
Password = Request.Form("txtPassword")
'Build connection with database
set conn = server.CreateObject ("ADODB.Connection")
conn.Open "DSN=mydsn","UID=","Pwd=;"
set rs = server.CreateObject ("ADODB.Recordset")
rs.Open "SELECT * FROM mydb where username='" & Session("Username")& "'", conn, 1