If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Command Text not set to command object - Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-07-06, 21:34
Cuttie0506 Cuttie0506 is offline
Registered User
 
Join Date: Jan 2006
Posts: 44
Command Text not set to command object - Search

For my 'status', when i select 1 or more options, it will be split up by a comma and get my results..

But when i did not select anything, i will get an error:

Command Text not set to command object.

The results i want to get is that if i did not select 'status', it will display all results from status column.

Code:
	If request.form ("status") <> "" Then
		strSentence1 = request.form("status")
	End If

	strSen1 = Split(strSentence1, ", ")

	sqlString = "SELECT * FROM Security_Vulnerability"

		For x=0 to ubound(strSen1)

			If x = 0 Then
            				sqlString = sqlString & " WHERE"
        			 Else
           				sqlString = sqlString & " OR"
        			End If

			sqlString = sqlString & " Status LIKE ('"& strSen1(x) &"%') AND Recipient LIKE ('"& strSentence2 &"%') AND Action_Taken LIKE ('"& strSentence3 &"%') AND Severity LIKE ('"& strSentence4 &"%') AND Week LIKE ('"& strSentence5 &"%') AND Class LIKE ('"& strSentence6 &"%') AND Business_Unit LIKE ('%"& strSentence7 &"%') AND Server_Name LIKE ('%"& strSentence8 &"%')"		

		
			rs_vServerName.Source = sqlString
		Next

		Response.write sqlString & "<br>"

		rs_vServerName.CursorType = 0
		rs_vServerName.CursorLocation = 2
		rs_vServerName.LockType = 1
		rs_vServerName.Open()


		If rs_vServerName.eof Then 
			
			response.redirect ("No_Query.asp")

		End If

		ServerArray = rs_vServerName.GetRows
Thanks if anyone could help me see whats the problem.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On