Jump to content

[RESOLVIDO] SELECT para Access2007 - VB.NET


kazzx
 Share

Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.