View Full Version : Text Box Value as SQL parametar?

06-25-2006, 09:24 AM
DreamWeaver MX 2004...
I Have problem with creating Recordset1__MMColParam (parameter) for search in MSAccess DB file.
How I can value of the textbox change into parametar (variable) for search Recordsets. Example if i write word STAR in textBox,...that mean textbox value= STARS, how the change parametar Recordset1__MMColParam for search into word STARS. Do I need push Butoon for thet operation. That like as some type of search engine for all RS STARS in MSAccess DB file.
Down is part of code with my problem...
Please help ?


Dim Recordset1__MMColParam

Recordset1__MMColParam = "" 'here is the problem, I want change Recordset1__MMColParam into word STARS

If (Request("MM_EmptyValue") <> "") Then
Recordset1__MMColParam = Request("MM_EmptyValue")
End If
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_CONNautoSMS_STRING

Recordset1.Source = "SELECT * FROM qry_StarsMAP WHERE MAPObjects LIKE '%" + Replace(Recordset1__MMColParam, "'", "''") + "%'"

Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1

Recordset1_numRows = 0