|
I am trying to retrieve from two table based on matching id and display data in a table.
here's my code:
<%@ Language = VBScript%>
<html>
<head>
<%
set conn=server.createobject("adodb.connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:/inetpub/wwwroot/database/HTC.mdb"
SQL = "select ID, CompanyName, ContactName, WhichTest, Description, Sample, Sample2, Sample3, Sample4, Sample5, Sample6, AbrasionHeadNo, TestMethod, Notes from tblCustomers, tblAbrasions where ID = CustID"
Set rs=conn.execute(SQL)
%>
<TABLE BORDER=1>
<TR>
<%
' Loop through each Field, printing out the Field Names
For i = 0 to objrs.fields.count - 1
%>
<TD><% = objrs(i).name %></TD>
<% next %>
</TR>
<%
' Loop through rows, displaying each field
while not objrs.eof
%>
<TR>
<% For i = 0 to objrs.fields.count - 1
%>
<TD VALIGN=TOP><% = objrs(i) %></TD>
<% Next %>
</TR>
<%
objrs.MoveNext
wend
objrs.Close
conn.close
%>
I got this error message:
Microsoft VBScript runtime (0x800A01A8)
Object required: ''
/project/report-sample.asp, line 22 (which is this line: For i = 0 to objrs.fields.count - 1 )
was my code incorrect?
thanks
|