Good Day I want to create a security log in that start up when the computer is turn on.
Im having problem on multi user once the user ID is logged in it also logged in in another computer, i dont know how to add this codes can some one help me this is my code in my log in form. im using vb.net 2005 and back end is MySQL. Thank You so much.

Private Sub btnLogIn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogIn.Click
Dim myCommand As New MySqlCommand
Dim myAdapter As New MySqlDataAdapter
Dim myData As MySqlDataReader

Dim SQL As String
'Our MySQL Query
Dim IDstudent As String = mtxtID.Text.Replace("'", "\'")
Dim Password As String = txtPassword.Text.Replace("'", "\'")
SQL = "SELECT * FROM `student` WHERE `idstudent` = '" + IDstudent + "' AND `password` = '" + Password + "'"

myCommand.Connection = conn
myCommand.CommandText = SQL
myAdapter.SelectCommand = myCommand
Try
'Try to execute the query
myData = myCommand.ExecuteReader()
myData.Read()
If myData.HasRows = 0 Then 'Checkes if a row with the user and password exist.
'If no outputs this:
MsgBox("StudentID and Password dont match!.")
myData.Close()
Else
'if yes outputs this:
MsgBox("Welcome " + myData.GetString("name") + "!.")
myData.Close()
mtxtID.Clear()
txtPassword.Clear()


Dim F2 As New LogIn(Me)
F2.Show()
Me.Hide()

End If
Catch ex As MySqlException
'If fail outputs MySQL Error
MsgBox(ex.Message)
Finally

End Try
RestartExplorer()
End Sub

First next time add the code inside the CODE Brakets

Second, have you tried adding a field "Status" on the Users table Ex.

Users Table
- id
- username
- password
- full name
- status [char(10)]

In which after you verified that the user is registered, verify if the user is set to Active, if its 'Active' then deny the login, else update the table field to Active and allow access to the next form

im sorry for the codes thank you for the reminder,
yes i have a table like that. my status is only int the default is zero, when the user logged in i want to update the 0 to 1 so that it is active and cannot log in again, but i dont know how to execute those codes inside my log in form.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.