kazzx Posted January 10, 2010 at 09:16 PM Report Share #305285 Posted January 10, 2010 at 09:16 PM estou com algumas dificuldades em fazer um select, pessoal. tenho isto: conn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & _ Application.StartupPath & "\BD Ponto JA.accdb" Dim cmd As OleDbCommand = conn.CreateCommand cmd.CommandText = "select Nome Completo from [inscrição Utente] where [Nome Completo] like '" & txtverifica.Text & "%'" 'cmd.CommandText = "Select nome FROM Utilizadores Where [nome] Like '" & txtverifica.Text & "%'" Dim cmdo As OleDbCommand = conn.CreateCommand cmdo.CommandText = "select Localidade from [inscrição Utente] where [Nome Completo] like '" & txtverifica.Text & "%'" 'cmdo.CommandText = "Select Localidade from Utilizadores Where [Nome] Like '" & txtverifica.Text & "%'" Dim cmde As OleDbCommand = conn.CreateCommand cmde.CommandText = "select Morada from [inscrição Utente] where [Nome Completo] like '" & txtverifica.Text & "%'" 'cmde.CommandText = "Select Morada from Utilizadores Where [Nome] Like '" & txtverifica.Text & "%'" 'Abre conexão .. conn.Open() e o programa diz-me que falta um operador, ou seja, algo no SQL está mal :x ajudas ? Link to comment Share on other sites More sharing options...
kazzx Posted January 10, 2010 at 09:19 PM Author Report Share #305287 Posted January 10, 2010 at 09:19 PM que cego, faltava-me os [ ] nos campos a seleccionar. do género .. cmd.CommandText = "select [Nome Completo] from [inscrição Utente] where [Nome Completo] like '" & txtverifica.Text & "%'" Link to comment Share on other sites More sharing options...
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