Forums

ASP

This topic is locked

split a querystring and process in recordset

Posted 18 Jan 2007 15:13:57
1
has voted
18 Jan 2007 15:13:57 Sandra Burne posted:
I'm trying to split a querystring and then use the individual parts to create a recordset.

On another forum I found a useful FOR NEXT loop

<pre id=code><font face=courier size=2 id=code>strsql = "SELECT fieldname FROM table WHERE"
searchsplit=split(strSearch," "
for x = 0 to ubound(searchsplit)
if x = 0 then
strsql = strsql & " search_field='"&searchsplit(x)&"'"
else
strsql = strsql & " OR search_field='"&searchsplit(x)&"'"
end if
next
</font id=code></pre id=code>

However, when I try to incorporate the above into the code into the recordset code in Dreamweaver 8 the binding disappears in the server behaviors window. In addition, I can't get the code to work.

The Dreamweaver recordset code is

<pre id=code><font face=courier size=2 id=code>Dim rsViewMusic
Dim rsViewMusic_cmd
Dim rsViewMusic_numRows

Set rsViewMusic_cmd = Server.CreateObject ("ADODB.Command"
rsViewMusic_cmd.ActiveConnection = MM_Rondinetto_STRING
rsViewMusic_cmd.CommandText = "SELECT fldUserName, UserAccess, AccessLevel, LastName, FirstName, Address1, CityName, Email, Website, Phone1, Languages, Instruments FROM Music_Teachers WHERE Instruments like ? and UserAccess &gt;1 and UserAccess &lt; 5 ORDER BY UserAccess desc, LastName asc"
rsViewMusic_cmd.Prepared = true
rsViewMusic_cmd.Parameters.Append rsViewMusic_cmd.CreateParameter("param1", 200, 1, 255, "%" + rsViewMusic__MMColParam + "%" ' adVarChar

Set rsViewMusic = rsViewMusic_cmd.Execute
rsViewMusic_numRows = 0
</font id=code></pre id=code>

Please can anyone shed some light on the matter.

Regards
Simcha

Reply to this topic