我已經成功做到login(即係link到個mdb)
但係點樣先可以做到 login Successful之後個form彈去另個一個form?
如果fail就轉唔到
以下係我打既code
Dim strCon As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Staff_Info.mdb;Persist Security Info=False"
Dim conn As New OleDbConnection(strCon)
Try
Dim dr As OleDbDataReader
Dim SID As String = txtStaffID.Text
Dim Pwd As String = txtPwd.Text
Dim strSQL As String = "Select * from Staff_Info where Staff_ID= '" & SID & "' and Staff_Pwd= '" & Pwd & "'"
Dim cmdLogin As New OleDbCommand(strSQL, conn)
conn.Open()
dr = cmdLogin.ExecuteReader
If dr.Read Then
lblMsg.Text = "Successful Login!"
Else
lblMsg.Text = "Login Failed!"
End If
conn.Close()
Catch ex As Exception
lblMsg.Text = ex.Message
End Try