vpess Posted August 21, 2009 at 05:19 PM Report #284070 Posted August 21, 2009 at 05:19 PM Boas, Ajudem-me por favor. Porque é que ao fazer a query desta forma me dá erro: ccombo2="nome" busca="vitor" ccombo1="nome" ccombo3="asc" SQL = "select * from socios where '" + CStr(ccombo2) + "' like '%" + CStr(busca) + "%' ORDER BY '" + CStr(ccombo1) + "' '" + CStr(ccombo3) + "'" e desta não SQL = "select * from socios where nome like '%vitor%' ORDER BY nome asc"
softklin Posted August 21, 2009 at 07:14 PM Report #284080 Posted August 21, 2009 at 07:14 PM Assim de repente parece ser das plicas que tens a mais na tua query no código vb. Tenta com: SQL = "select * from socios where '" + CStr(ccombo2) + "' like '%" + CStr(busca) + "%' ORDER BY " + CStr(ccombo1) + " " + CStr(ccombo3) Nick antigo: softclean | Tens um projeto? | Wiki P@P Ajuda a comunidade! Se encontrares algo de errado, usa a opção "Denunciar" por baixo de cada post.
vpess Posted August 21, 2009 at 10:11 PM Author Report #284115 Posted August 21, 2009 at 10:11 PM Exactamente era das plicas 😉 SQL = "select * from socios where " + CStr(ccombo2) + " like '%" + CStr(busca) + "%' ORDER BY " + CStr(ccombo1) + " " + CStr(ccombo3) + " "
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now