Forum Moderators: open
i am trying to get this code to work, but it seems to have a problem with it, please help.
this is what i get on the page
Microsoft VBScript runtime error '800a01a8'
Object required: ''
and heres the ASP code ..
<!--#include file = "chklog.asp"-->
<!--#include file="include2.asp"-->
<% Dim Conn,rs,req,Config
req = Request("id")
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Provider = "Microsoft.Jet.OLEDB.4.0"
Conn.ConnectionString = "Data Source=" & Path
Conn.Open
Set Rs = Server.CreateObject("ADODB.Recordset")
Set Config= Server.CreateObject("ADODB.Recordset")
Rs.Open "SELECT * from users where cd_userid='" & req & "'", Conn, 1,3
%>
<table border="1">
<%
Do While Not rstSimple.EOF
%>
<tr>
<td><%= rstSimple.Fields("cd_userid").Value %> </td>
<td><%= rstSimple.Fields("txt_name").Value %> </td>
<td><%= rstSimple.Fields("txt_surname").Value %> </td>
<td><%= rstSimple.Fields("txt_street").Value %> </td>
</tr>
<%
rstSimple.MoveNext
Loop
%>
</table>
<%
' Close our recordset and connection and dispose of the objects
rstSimple.Close
Set rstSimple = Nothing
cnnSimple.Close
Set cnnSimple = Nothing
%>
This don't jive:
Set Rs = Server.CreateObject("ADODB.Recordset")
Set Config= Server.CreateObject("ADODB.Recordset")
Rs.Open "SELECT * from users where cd_userid='" & req & "'", Conn, 1,3
With this:
Do While Not rstSimple.EOF
And this is not necessary:
Set Config= Server.CreateObject("ADODB.Recordset")
Unless you've got somthing going on here that we don't know about:
<!--#include file = "chklog.asp"-->
<!--#include file="include2.asp"-->
So try doing this:
Set rstSimple= Server.CreateObject("ADODB.Recordset")
Rem - Set Config= Server.CreateObject("ADODB.Recordset")
rstSimple.Open "SELECT * from users where cd_userid='" & req & "'", Conn, 1,3
thanks for the advice, i have got it to wrok after making some major changes, but can not get it to loop, and can only see the first users details,
this is the new code
<html>
<!--#include file = "chklog.asp"-->
<!--#include file="include2.asp"-->
<% Dim Conn,rs,Config
'req = Request("id")
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Provider = "Microsoft.Jet.OLEDB.4.0"
Conn.ConnectionString = "Data Source=" & Path
Conn.Open
Set Rs = Server.CreateObject("ADODB.Recordset")
Set Config= Server.CreateObject("ADODB.Recordset")
Rs.Open "SELECT * from users where cd_userid;", Conn, 1,3
%>
<% if rs.EOF Then %>
<table border="1">
<% else %><br> user ID = <%=rs("cd_userid")%>
<br>
<%=rs("txt_name")%><%=rs("txt_surname")%>
<br> <%=rs("txt_street")%>
<br> <%=rs("txt_town")%>
<br> <%=rs("txt_city")%>
<br> <%=rs("txt_country")%>
<br> <%=rs("txt_postcode")%>
<br> <%=rs("txt_tel")%>
<br> <%=rs("txt_email")%>
<br> <%=rs("txt_password")%>
<br> <%=rs("ZONE_ID")%>
<%
Rs.MoveNext
set Rs=nothing
set Config=nothing
set Conn=nothing
%>
</table>
<% end if %>
</html>
<html>
<!--#include file = "chklog.asp"-->
<!--#include file="include2.asp"-->
<%
Dim Conn, rs
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Provider = "Microsoft.Jet.OLEDB.4.0"
Conn.ConnectionString = "Data Source=" & Path
Conn.Open
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "SELECT * from users where cd_userid;", Conn, 1,3
Response.Write "<TABLE BORDER=1><TR><TD>"
If Not rs Is Nothing Then
If Not rs.BOF And Not rs.EOF Then
rs.MoveFirst
Do While Not rs.EOF
%>
user ID = <%=rs("cd_userid")%><BR>
<%=rs("txt_name")%> <%=rs("txt_surname")%><BR>
<%=rs("txt_street")%><BR>
<%=rs("txt_town")%><BR>
<%=rs("txt_city")%><BR>
<%=rs("txt_country")%><BR>
<%=rs("txt_postcode")%><BR>
<%=rs("txt_tel")%><BR>
<%=rs("txt_email")%><BR>
<%=rs("txt_password")%><BR>
<%=rs("ZONE_ID")%><BR>
<%
rs.MoveNext
Loop
End If
End If
Response.Write "</TD></TR></TABLE>"
Set rs = Nothing
Set conn = Nothing
%>
</html>
just when i thought it was all fine when i ran the same code on bigger DB i got another error,
Response object error 'ASP 0251 : 80004005'
Response Buffer Limit Exceeded
Execution of the ASP page caused the Response Buffer to exceed its configured limit
i think the page might be in a infinite loop.
any advice..
Thanks