Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim conn As ADODB.Connection
- Dim admin As ADODB.Recordset
- Dim adm As String
- Private Sub Form_Load()
- connserver
- End Sub
- Private Sub connserver()
- Set conn = New ADODB.Connection
- conn.ConnectionString = "Driver={MySQL ODBC 3.51 Driver};SERVER=localhost;Database=advising;User=root;Password=12345; OPTION=3"
- conn.Open
- End Sub
- Private Sub Image1_Click()
- Checkuser
- End Sub
- Private Sub Checkuser()
- Dim admin As ADODB.Recordset
- Dim adm As String
- On Error GoTo a
- Set admin = New ADODB.Recordset
- admin.CursorLocation = adUseServer
- adm = "select * from adminrec where UserName = '" & Text1.Text & "' and Password = '" & Text2.Text & "'"
- admin.Open adm, conn
- MsgBox "Welcome " & admin!AdminName
- Unload Me
- adminfrm.Show
- Exit Sub
- a:
- MsgBox "Unauthorized Personel!"
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement