简体   繁体   中英

Querying a Yes/No field in an Access database from VB.NET

I am creating a registration form for employees and members. When creating an account for members and employees there must be a difference when creating the account because they will have different options. I check a box to differentiate employee from member and save it in the database. My question is how can I query the database to know if the box is checked or not. This is what I have but it does not work.

Dim login = Me.LibraryMembersTableAdapter1.IDPass(txtID.Text, txtPass.Text)

Dim EmployeeCheck = LibraryMembersTableAdapter1.EmployeeCheck(Employee:=True)

If login Is Nothing Then
    MsgBox("Input Error")
Else
    MsgBox("Welcome!")
End If

If EmployeeCheck = True Then
    frmEmployee.Show()
Else
    Member.Show()
End If

Yes/No boxes are bits. Their values are -1 and 0 respectively. See this question for more info, which is quite similar.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM