TheShadow2000
Programmer
- Dec 20, 2001
- 4
I have an ASP page in which I connect to a database twice. The first time, the page retrieves a Category ID based on input from the previous page. After that, the page is to search a different table and retrieve all entries that have the above mentioned Category ID number. Howevever, when I try to perform a loop, I get a Type Mismatch Error. My code is below. Note that the variable catnum was defined before this code.
Set objConn2 = Server.CreateObject("ADODB.Connection"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
strConnection2 ="DSN=ASPDB;Database=ASPDB;"
objConn2.open strConnection2
strQuery2 = "Select Name, URL FROM Favorites WHERE Category_ID = "
strQuery2 = strQuery2 & catnum
Set objRS2 = objConn2.Execute(strQuery2)
While Not objRS2.EOF
Response.write "<a href=" & "'" & objRS("URL"
& "'" & ">"
Response.write objRS("Name"
& "</a>" & "<br>"
objRS2.MoveNext
Wend
objRS2.close
objConn2.close
Set objRS2=nothing
Set objConn2=nothing
The error occurs on the line "While Not objRS2.EOF"
Any and all help is greatly appreciated. Hopefully its only a dumb error on my part.
Thanks.
Set objConn2 = Server.CreateObject("ADODB.Connection"
strConnection2 ="DSN=ASPDB;Database=ASPDB;"
objConn2.open strConnection2
strQuery2 = "Select Name, URL FROM Favorites WHERE Category_ID = "
strQuery2 = strQuery2 & catnum
Set objRS2 = objConn2.Execute(strQuery2)
While Not objRS2.EOF
Response.write "<a href=" & "'" & objRS("URL"
Response.write objRS("Name"
objRS2.MoveNext
Wend
objRS2.close
objConn2.close
Set objRS2=nothing
Set objConn2=nothing
The error occurs on the line "While Not objRS2.EOF"
Any and all help is greatly appreciated. Hopefully its only a dumb error on my part.
Thanks.