command text not set error

message from -D- on 17 Jul 2004
Command text was not set for the command object.
/supercircuits/results.asp, line 30

I've never encountered this error before. Is there a problem with the
syntax? Anyone see where the problem is occurring?

Here is the code to the page:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/DBConn.asp" -->
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If (Request.Form("txtKeywords") <> "") Then
Recordset1__MMColParam = Request.Form("txtKeywords")
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_DBConn_STRING
strTest = Request.Form("selMatchType")
Select Case strTest
Case Exact
Recordset1.Source = "SELECT * FROM tblProducts WHERE prod_number = '" +
Replace(Recordset1__MMColParam, "'", "''") + "'"
Case Ending
Recordset1.Source = "SELECT * FROM tblProducts WHERE prod_number = '" +
Replace(Recordset1__MMColParam, "'", "''") + "'"
Case Contain
Recordset1.Source = "SELECT * FROM tblProducts WHERE prod_number = '" +
Replace(Recordset1__MMColParam, "'", "''") + "'"
Case Begin
Recordset1.Source = "SELECT * FROM tblProducts WHERE prod_number = '" +
Replace(Recordset1__MMColParam, "'", "''") + "'"
End Select
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()

Recordset1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<%
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
%>
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><%=(Recordset1.Fields.Item("id").Value)%></td>
<td><%=(Recordset1.Fields.Item("prod_number").Value)%></td>
</tr>
</table>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>

Thanks for any help.
-D-
 
Paul Anthony replied to -D- on 17 Jul 2004
I think your case isn't being fired- try

Case Else Recordset1.Source = "SELECT * FROM tblProducts WHERE prod_number
= '" + Replace(Recordset1__MMColParam, "'", "''") + "'"
End Select

just to test it. It may be you are forgetting about your querystring

Paul..

"-D-" <noone@nospam.com> wrote in message
news:cdbalp$fb2$1@forums.macromedia.com...
 
-D- replied to Paul Anthony on 17 Jul 2004
Hi Paul,
Thanks for replying to my post. Do I only need to add the statement below
to the last SQL statement line or all four? I appreicate the help as I'm
pretty new to SQL.

Thanks again.
-D-

"Paul Anthony" <paulantz22(NOSPAM)@hotmail.com> wrote in message
news:cdbk8d$npp$1@forums.macromedia.com...
 
-D- replied to -D- on 17 Jul 2004
Paul,]
I added
Case Else Recordset1.Source ...etc.

to the last statement line and do not recieve the error message now. But,
the reults page doesn't display anything. No records are displayed? Any
thoughts?

Thanks.
-D-

"-D-" <noone@nospam.com> wrote in message
news:cdbu3h$31t$1@forums.macromedia.com...
+
charset=iso-8859-1">
 
Paul Anthony replied to -D- on 18 Jul 2004
Its looks like your strings are not inside quotes for starters.
response.write your form data out to see what you are receiving to debug

response.write(Request.form("blah")
Response.End

then see which statement is being fired by doing the same
remove the first response.end and move it to the case else..try
experimenting with none filtered recordsets
i.e. case else =select * instead of WHERE = blah. Contact me off list if you
wish.

HTH,
Paul.

"-D-" <noone@nospam.com> wrote in message
news:cdbuiq$3f3$1@forums.macromedia.com...
 
-D- replied to Paul Anthony on 18 Jul 2004
Paul,
Thanks for your help! I finally got it working.
-D-

"Paul Anthony" <paulantz22(NOSPAM)@hotmail.com> wrote in message
news:cde0g3$s7a$1@forums.macromedia.com...
 

Archived message: command text not set error (Macromedia Dreamweaver)