The description of your problem suggests to me that the variable strCat is
empty. This would cause the error message that you are getting.
Check that there is a valid string in the querystring for ?cat= . You should
see it in the address bar as a quick check.

----- Original Message ----- 
From: "floorbamboo" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Friday, March 18, 2005 6:21 AM
Subject: [AspClassicAnyQuestionIsOk] can't pass requeststring to db


>
>
> Please show me where i went wrong.
>
> This code works fine when i hard-code the WHERE condition, but
> doesn't work when i pass a WHERE condition from outside. Instead i
> get an error code:
>
> Error Type:
> ADODB.Recordset (0x800A0BCD)
> Either BOF or EOF is True, or the current record has been deleted.
> Requested operation requires a current record.
> /own/test4.asp, line 30
>
> My link is "test3.asp?cat=news"
>
> The code is as ff:
>
> <%
> Dim objRS
> Dim objConn
> Dim strDBPath
> dim strCat
> Dim arrDBData
> Dim i,j
> Dim iRecFirst, iRecLast
> Dim iFieldFirst, iFieldLast
> Dim objSQL
>
> strDBPath = Server.MapPath("/db/db_own.mdb")
> set objConn = Server.CreateObject("ADODB.Connection")
> objConn.open = "Provider=Microsoft.Jet.Oledb.4.0;data source=" &
> strDBPath & ";"
> set objRS = Server.CreateObject("ADODB.Recordset")
>
> strCat = request.QueryString("cat")
>
> objSQL = "SELECT * FROM articles WHERE Theme=' & strCat & '"
> set objRS = objConn.Execute(objSQL)
> arrDBData = objRS.GetRows( , , Array("Title", "Description"))
> objRS.close
> set objRS = Nothing
> objConn.close
> set objConn = Nothing
> iRecFirst = LBound (arrDBData, 2)
> iRecLast = UBound (arrDBData, 2)
> iFieldFirst = LBound (arrDBData, 1)
> iFieldLast = UBound (arrDBData, 1)
> %>
> <table border="1">
> <tr>
> <%
> For i = iRecFirst To iRecLast
> Response.Write "<tr>" & vbCrLf
> For j = iFieldFirst To iFieldLast
> Response.Write vbTab & "<td>" & arrDBData(j, i) & "</td>" &
> vbCrLf
> Next
> Response.Write "</tr>" & vbCrLf
> Next
> %>
>
> Thanks.
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to