Hi
I am trying to move from a DSN connection string to a DSNless connection and for some reason I get an error when I try to do it.
My DSN connection was this
Dim objpharws50
Set objpharws50 = Server.CreateObject("ADODB.Connection")
objpharws50.Open "DSN=prescript"
and I have changed to this
strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath(".\electronic.mdb") & ";"
Set objpharws50 = Server.CreateObject("ADODB.Connection")
objpharws50.Open strConnection
The part of my code that I now get an error on is this line
rscheckpass.open strSQL, objpharws50, 3,3
in the code below????
Set rscheckpass = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT names.password, names.surname, names.ward" & _
" From names" & _
" WHERE names.password= '" & session("password") & "' AND names.surname= '" & session("surname") & "';"
rscheckpass.open strSQL, objpharws50, 3,3
If rscheckpass.eof then
response.redirect"error.asp"
else
Do while Not rscheckpass.eof
Session("ward") = rscheckpass("ward")
rscheckpass.movenext
loop
end if
rscheckpass.close
set rscheckpass = nothing
I am trying to move from a DSN connection string to a DSNless connection and for some reason I get an error when I try to do it.
My DSN connection was this
Dim objpharws50
Set objpharws50 = Server.CreateObject("ADODB.Connection")
objpharws50.Open "DSN=prescript"
and I have changed to this
strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath(".\electronic.mdb") & ";"
Set objpharws50 = Server.CreateObject("ADODB.Connection")
objpharws50.Open strConnection
The part of my code that I now get an error on is this line
rscheckpass.open strSQL, objpharws50, 3,3
in the code below????
Set rscheckpass = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT names.password, names.surname, names.ward" & _
" From names" & _
" WHERE names.password= '" & session("password") & "' AND names.surname= '" & session("surname") & "';"
rscheckpass.open strSQL, objpharws50, 3,3
If rscheckpass.eof then
response.redirect"error.asp"
else
Do while Not rscheckpass.eof
Session("ward") = rscheckpass("ward")
rscheckpass.movenext
loop
end if
rscheckpass.close
set rscheckpass = nothing