Thanks for your replys
This is the vb / sql code which is generated - what I want is the equivlent in js
-----
<%
'VBScript version of Basic-UltraDev Dyamic Search SQL
'for Recordset1
Dim tfm_andor,tfm_exact
tfm_andor = "AND"
tfm_exact = "false"
'if any words option
'not implemented
'if exact phrase option
'not implemented
If Cstr(Request("search"

)<> "" Then
Dim tfm_SQLstr,tfm_searchField,tfm_databaseFields,bellChar
tfm_SQLstr = " WHERE ("
tfm_searchField = lcase(Request("search"

)
tfm_databaseFields = Split("Bands,Town",","

bellChar = chr(7)
If InStr(tfm_searchField,chr(34)) Or tfm_exact = "true" Then
tfm_searchField = Replace(tfm_searchField,chr(34),""

tfm_andor = "OR"
ElseIf InStr(lcase(tfm_searchField)," or "

Then
tfm_searchField = Replace(tfm_searchField," or ",bellChar)
tfm_andor = "OR"
ElseIf InStr(tfm_searchField,","

Or InStr(tfm_searchField," "

Or InStr(lcase(tfm_searchField)," and "

Then
tfm_searchField = Replace(tfm_searchField," and ",bellChar)
tfm_searchField = Replace(tfm_searchField,",",bellChar)
tfm_searchField = Replace(tfm_searchField," ",bellChar)
End If
splitField = Split(tfm_searchField,bellChar)
For i = 0 to ubound(splitField)
For j = 0 to ubound(tfm_databaseFields)
tfm_SQLstr = tfm_SQLstr & "(" & tfm_databaseFields(j) & " LIKE '%" & Replace(splitField(i),"'","''"

& "%')"
If j < ubound(tfm_databaseFields) Then tfm_SQLstr = tfm_SQLstr & " OR "
Next
If i < ubound(splitField) Then tfm_SQLstr = tfm_SQLstr & "

" & tfm_andor & " ("
Next
tfm_SQLstr = tfm_SQLstr & "

"
Else
tfm_SQLstr = ""
End If
%>
<%
set Recordset1 = Server.CreateObject("ADODB.Recordset"

Recordset1.ActiveConnection = MM_punkoiuk_STRING
Recordset1.Source = "SELECT * FROM gigdates" + tfm_SQLstr +""
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
Recordset1_numRows = 0
%>