خرید بک لینک

Vote count: 0

Syntax error (missing operator) in query expression 'Useame ='admin' [Password] ='admin' AND AccountType = Admin''.

Dim co As New OleDbCoection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:UsersJenDocumentsJadevbdatabase.accdb")

    txtAdmin.Text = "Admin"

    Dim strsql As New OleDbCommand("select * from Login where Useame ='" & txtUseame.Text & "' [Password] ='" & txtPassword.Text & "' AND AccountType = Admin'", co)
    Dim uu As New OleDbParameter("UserName", txtUseame.Text)
    Dim pp As New OleDbParameter("Password", txtPassword.Text)
    strsql.Coection.Open()

    Dim reader As OleDbDataReader
    reader = strsql.ExecuteReader

    If reader.HasRows Then
        strsql.Coection.Close()


        MsgBox(" Successfully Logged in!", vbInformation)

        frmIndex.Show()
        desktopFade.Close()

    ElseIf txtUseame.Text = "" And txtPassword.Text = "" Then
        MsgBox("Don't leave the fields blank", vbCritical)
        txtUseame.Focus()

    Else

        MsgBox("Your Useame or Password is invalid", MsgBoxStyle.Critical)
        Me.txtUseame.Text = ""
        Me.txtPassword.Text = ""
        Me.txtUseame.Focus()
        strsql.Coection.Close()


    End If

i have 2 user in the database. the admin and the user. if the useame and password account type is = Admin then ADMIN Account show while if the useame and password input is for the user then USER Account show. On my code, i'm trying to solve first the admin but i need everyone help. T.T

asked 58 secs ago

برچسب: نویسنده: استخدام کار تاريخ: شنبه 22 اسفند 1394 ساعت: 14:10

صفحه بندی