Click to See Complete Forum and Search --> : simple as pie!


dave-g-o
October 4th, 2006, 05:54 AM
dont suppose any1 can tell me whats wrong with this:(syntax)

cSQL = "SELECT PERSNO FROM PERSON WHERE PERSNO LIKE" & Quote(Request("SOURCE"))%

thanks

HairyMonkeyMan
October 4th, 2006, 06:48 AM
Have you tried this?

cSQL = "SELECT PERSNO FROM PERSON WHERE PERSNO LIKE" & Quote(Request("SOURCE")) & "%"

or

cSQL = "SELECT PERSNO FROM PERSON WHERE PERSNO LIKE @SOURCE"

and add a parameter into your command object i.e
dbComm.Parameters.Add(New SqlParameter("@SOURCE", Quote(Request("SOURCE")))

jvbd02
October 6th, 2006, 08:43 PM
A space between the LIKE and the " will be needed (I think?).

Can't comment on the rest of the query though...

edwinMuthu
October 7th, 2006, 03:38 AM
cSQL = "SELECT PERSNO FROM PERSON WHERE PERSNO LIKE '" & Quote(Request("SOURCE")) & "%'"

i think so Single quotes missing