What am I missing ....
I feel like a complete doodle .....
You are allowed to laugh and slap your knees :-)
whatinput = "Coldstreet 123A 12345 Freezytown"
array = whatinput.split(" ")
SQL = "SELECT CL.organisation, CA.street,CA.zipcode,CA.city,RG.state,RG.stateID,KO.county,KO.countyID "&_
"FROM tbclientaddress CA "&_
"JOIN tbclients CL ON CA.clientlink = CL.clientID "&_
"JOIN tbstate RG ON CA.state = RG.stateID "&_
"JOIN tbcounty KO ON CA.county = KO.countyID "&_
"WHERE " For numero = 0 To UBounds(array)
If numero = 0 Then SQL = SQL & " CA.street LIKE '%" & array(numero) & "%' "&_
If numero = 1 Then SQL = SQL & " OR CA.streetnumber LIKE '%" & array(numero) & "'" &_
If numero = 2 Then SQL = SQL & " OR CA.zipcode LIKE '%" & array(numero) & "%'" &_
If numero = 3 Then SQL = SQL & " OR CA.city LIKE '%" & array(numero) & "%'" &_
If numero > 3 Then SQL = SQL & " OR CA.city LIKE '%" & array(numero) & "%" & array(numero-1) & "%' OR CA.city LIKE '%" array(numero) & "%'"
Next
execute(sql)
Set RS = Server.CreateObject("ADODB.recordset")
RS.Open SQL,Conn
Do While Not RS.EOF
etc.. etc..
I tried this also without the execute(sql).