[thelist] Command text was not set for the command object.
Paul Backhouse
paul.backhouse at 2cs.com
Fri Nov 30 08:18:33 CST 2001
hi, using Access to do search facility, basically from a dropdown box they
click search by strength, this then check the database for any record that
has a value in the 'strength' cell - it then displays them in a list - this
bit work fine.
The 'strength' is measured on a scale of 1 to 5, i have added abit that lets
them find records that hav 'strength' at a value of 5 (for example).
There is one record available, im using querystrings to tell the strQuery
what strenght is equal to.
<a href="Results.asp?SearchType2=strength&SChoice=5">Strength = 5</a>
-----------------------------------------------------------
The error im getting is:
Microsoft OLE DB Provider for ODBC Drivers error '80040e0c'
Command text was not set for the command object.
/work/knightsbridge/registered/Results.asp, line 82
--------------------------------------------------------
The code im using is:
-----------------------------------------------------------
<%
SearchType = request.form("SearchType")
SearchType2 = request.querystring("SearchType2")
SChoice = request.querystring("SChoice")
-- general other ElseIfs above this line of code --
ElseIF SearchType = "strength" Then
If SChoice > "" Then
ThisOne = "= "& SChoice &""
Else
ThisOne = "> '""""'"
End If
Archive = "0"
ThisStart = "SELECT * FROM tblData WHERE (Strength "& ThisOne &") AND
(Archive = "& Archive &") ORDER BY idate DESC"
Const adUseClient = 3
Const adOpenKeyset = 1
Const adLockReadOnly = 1
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.open strConn
If SurSearch > "" Then
strQuery = "SELECT * FROM tblData WHERE Surname LIKE '%" & SurSearch & "%'
ORDER BY Surname ASC"
Else
strQuery = ""& ThisStart &""
End If
'response.write strQuery'
Set objRS = objConn.Execute(strQuery)
%>
is this confusing or do you get it - does anyone know how to fix the error
im getting?
cheers
paul
More information about the thelist
mailing list