I try to establish a login with a (test) Access database users.mdb => 1 table : userlist with 5 fields (and 4 test records)
field 1 => ldn-ID (autonumber = long integer)
field 2 => Fname (text)
field 3 => Lname (text)
(field 4 => username)
(field 5 => password)
<%
'Check if user is logged in
if Session("uid") = "" then
'If not, go to login page
Response.Redirect("login.asp")
else
'If, build page
Response.Write("<title>ASP Page</title>")
Response.write("<center>Welcome " & Session("uid") & "<br><a href=logout.asp>Logout</a></center>")
Response.Write (Session("uid")) => TEST => I receive : 3 => login.asp works and verify.asp 'takes' 3 (third record) from the database = OK
set conn = server.CreateObject ("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath ("users.mdb")
set rs = server.CreateObject ("ADODB.Recordset")
rs.Open "SELECT Fname,Lname FROM userlist WHERE session("uid") = '"& ldn-id &"'", conn, 1
If I try to become the corresponding names from the same record (n° 3) => the browser gives the following error :
Microsoft VBScript compilation error '800a0401'
Expected end of statement
/test_apple/default.asp, line 33
rs.Open "SELECT Fname,Lname FROM userlist WHERE session("uid") = '"& leden-id &"'", conn, 1
------------------------------------------------------------------^
What is wrong with the code ?
Thank for tips - Leifoet
field 1 => ldn-ID (autonumber = long integer)
field 2 => Fname (text)
field 3 => Lname (text)
(field 4 => username)
(field 5 => password)
<%
'Check if user is logged in
if Session("uid") = "" then
'If not, go to login page
Response.Redirect("login.asp")
else
'If, build page
Response.Write("<title>ASP Page</title>")
Response.write("<center>Welcome " & Session("uid") & "<br><a href=logout.asp>Logout</a></center>")
Response.Write (Session("uid")) => TEST => I receive : 3 => login.asp works and verify.asp 'takes' 3 (third record) from the database = OK
set conn = server.CreateObject ("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath ("users.mdb")
set rs = server.CreateObject ("ADODB.Recordset")
rs.Open "SELECT Fname,Lname FROM userlist WHERE session("uid") = '"& ldn-id &"'", conn, 1
If I try to become the corresponding names from the same record (n° 3) => the browser gives the following error :
Microsoft VBScript compilation error '800a0401'
Expected end of statement
/test_apple/default.asp, line 33
rs.Open "SELECT Fname,Lname FROM userlist WHERE session("uid") = '"& leden-id &"'", conn, 1
------------------------------------------------------------------^
What is wrong with the code ?
Thank for tips - Leifoet