Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Dim Con, sql, rec
set Con = Server.CreateObject("ADODB.Connection")
Con.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("db/logins.mdb")
UserID = Session("sesUserName")
SQL = "SELECT * FROM cust_logins WHERE [USERNAME]= '"& UserID &"' "
'response.write(sql)
Response.Write("<table border=1><tr><th>CustName</th><th>Cuser</th><th>CPass</th><th>Email</th></tr>")
Do While Not rec.EOF
Response.Write("<tr>")
Response.Write("<td>")
Response.Write(rec("CustName"))
Response.Write("</td>")
Response.Write("<td>")
Response.Write(rec("USERNAME"))
Response.Write("</td>")
Response.Write("<td>")
Response.Write(rec("USERPASS"))
Response.Write("</td>")
Response.Write("<td>")
Response.Write(rec("Email"))
Response.Write("</td>")
Response.Write("</tr>")
Response.Write("</table>")
rec.MoveNext
Loop
Con.Close
%>
<%Session("sesUserName")=Request.Form("username")%>
<%=Response.Write("Welcome ")%>
<%= Response.Write(Session("sesUserName"))%>
monksnake said:you are not opening not closing the recordset.[/quote monksnake]
Are you saying that I am not closing the recordset?
I corrected it like so:
I then put the closing statement at the bottom like so:Code:set Con = Server.CreateObject("ADODB.Connection") set rec=Server.CreateObject("ADODB.Recordset")
The error it generates is:Operation is not allowed when the object is closed.line 19Code:rec.MoveNext Loop Con.Close Rec.close
Line 19 isI apologize if I am not getting it. Thanks for link, I read it and am still reading it.Code:Do While Not rec.EOF
~E
rec.MoveNext
Loop
Con.Close
Rec.close
rec.MoveNext
Loop
rec.close
Con.Close
Dim Con, sql, rec
set Con = Server.CreateObject("ADODB.Connection")
Con.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("db/logins.mdb")
UserID = Session("sessUserName")
SQL = "SELECT * FROM custlogins WHERE [USERNAME]= '"& UserID &"' "
set rec=Con.execute(sql)