hello!im trying to search the databse and this is my asp code:
<%@Language=VBScript%>
<% Response.Buffer = True %>
<html>
<head><title></title></head>
<body>
<%
Dim MyConn, SQL, RS, srchval, i
'srchval = Replace(Request.Form("searchvalue"), "'", "''")
'srchall = Request.Form("all")
Set MyConn=Server.CreateObject("ADODB.Connection")
Set RS=Server.CreateObject("ADODB.RecordSet")
dbpath = server.mappath("First.mdb")
MyConn.mode = admodereadwrite
MyConn.Open "Provider = Microsoft.Jet.OLEDB.4.0; Data source = " & dbpath
RS.Open "Select * From food", MyConn
If request.form("checkbox1") = Sugar Then
SQL = "Select * From food Where ItemName Like '%"&request.form("checkbox1")&"%'"
End If
>>Set RS=MyConn.Execute(SQL)
If request.form("checkbox1") <> "" Then
If RS.BOF And RS.EOF Then
Response.Write "No Records Found."
Else
Response.Write "<center><table border=""1""><tr>"
For i = 0 To RS.Fields.Count - 1
Response.Write "<th>" & RS(i).Name & "</th>"
Next
Response.Write "</tr>"
While Not RS.EOF
Response.Write "<tr>"
For i = 0 To RS.Fields.Count - 1
Response.Write "<td>" & RS(i).Value & "</td>"
Next
Response.Write "</tr>"
RS.MoveNext
Wend
Response.Write "</table>"
End If
'Else
'Response.Redirect "search.asp"
End If
RS.Close
MyConn.Close
Set RS = Nothing
Set MyConn = Nothing
%>
</body>
</html>
im getting this error:Microsoft JET Database Engine (0x80040E0C)
Command text was not set for the command object.at the line with >>.