|
the following code gives me this error message:
ADODB.Recordset (0x800A0CC1)
Item cannot be found in the collection corresponding to the requested name or ordinal.
/tutorial/function.asp, line 51 (which is this line: strConName = rs(ContactName))
i tried to disable it and go on to the next line; still the same error.
<%
'declare variables
dim strCoName, ConName, strAddress, strCity, strState, strZip, strWhichTest, strDesc, dblSample, dblSample2, dblSample3, dblSample4, dblSample5, dblSample6, strAbrasionHeadNo, TMethod, TestNotes
'connection to database
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, Address, City, State, Zipcode, Country, PhoneNumber, FaxNumber, Email, SubmitDate, SampleDesc, RequestTest, RequestTest2, AbrasionId, TestRequestNo, CustID, WhichTest, Description, Sample, Sample2, Sample3,Sample4, Sample5, Sample6, AbrasionHeadNo, TestMethod, Notes from tblCustomers, tblAbrasions where ID = CustID"
Set rs=conn.execute(SQL)
' Execute a query using the connection object. It automatically
' creates and returns a recordset which we store in our variable.
if Not rs.EOF then
rs.movefirst
strCoName=rs("CompanyName")
response.write strCoName
strConName = rs(ContactName)
response.write strConName
'strAddress = rs(Address)
'response.write strAddress
'strCity = rs(City)
'strState = rs(State)
'strZip = rs(Zip)
'strWhichTest = rs(WhichTest)
end if
rs.Close
set rs = nothing
conn.close
set conn = nothing
%>
Ii did this first: sql="Select * from tblCustomers, tblAbrasions where ID = CustID" then when i went online and search for help. One of the forum suggest to put all the variable name on the sql line, it didn't makes any differences. To ensure that i spell the name correctly, i export the column to excel then from excel to notepad to my asp pages. still didn't work.
can someone help?
|