Hi,
I'm with a little problem, here is the code:
[VB] Code:
Imports System Imports System.Data Imports System.Data.OleDb Public Class LoginForm1 Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click Dim ConexaoBD As OleDbConnection Dim DsDados As DataSet Dim sqlStringUser As String = "SELECT * FROM user WHERE USERNAME='" & tbUsername.Text & "' and PASSWORD='" _ & tbPassword.Text & "'" ConexaoBD = New OleDbConnection(connstring) Dim AdaptadorDadosUser As OleDbDataAdapter = New OleDbDataAdapter(sqlStringUser, ConexaoBD) DsDados = New DataSet() AdaptadorDadosUser.Fill(DsDados, "user") If DsDados.Tables("user").Rows.Count() = 0 Then MsgBox("Username ou Password Errada", MsgBoxStyle.Critical + MsgBoxStyle.OkOnly, "ERRO") tbUsername.Text = "" tbPassword.Text = "" tbUsername.Focus() Else frmmdi.Show() Me.Close() End If End Sub Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click Me.Close() End Sub End Class
the problem is when I try to login, there a bug says there is a error sintax in the "from"




Reply With Quote