Hello,
How do you do a parameterized query with a LIKE operator, this is what I have? Please help
set command = Server.CreateObject("ADODB.Command")
command.ActiveConnection= con command.Prepared = true command.CommandType = adCmdText
if alpha = "A" then command.CommandText = "SELECT pid,crcod,crloc,coname FROM CRDCUST WHERE coname LIKE ? or isnumeric(substring(coname,1,1)) =1 ORDER BY coname"
else command.CommandText = "SELECT pid,crcod,crloc,coname FROM CRDCUST WHERE coname LIKE ? ORDER BY coname"
end if
command.Parameters.Append command.CreateParameter("@coname", adVarWChar, adParamInput, 250, alpha +"%")
set rsSort = command.Execute