hello can you please help me and please correct my code if this is wrong. please also check my cursor type if it is correct..hoping for your positive responds...
Option Explicit
Public con As ADODB.Connection
Public user_rs As ADODB.Recordset
Public cmd As ADODB.Command
Public m_user As String
Public m_pass As String
Public sql As String
Private Sub Form_Load()
Set con = New ADODB.Connection
Set user_rs = New ADODB.Recordset
Set cmd = New ADODB.Command
With con
.ConnectionString = "provider = microsoft.jet.oledb.4.0; data source =" & App.Path & "\project.mdb"
.Open
End With
Me.Move (Screen.Width - Width) \ 2, (Screen.Height - Height) \ 2
End Sub
Private Sub cmdlog_Click()
m_user = Trim(txtuser.Text)
m_pass = Trim(txtpass.Text)
If user_rs.State = adStateOpen Then
user_rs.Close
End If
sql = "select * from security where user_name = '" & m_user & "' and user_pass = '" & m_pass & "'"
user_rs.Open sql, con, adOpenDynamic, adLockPessimistic
If user_rs.BOF = True And user_rs.EOF = True Then
MsgBox "Sorry username and password cannot be found..Please
Register if you don't have Account", vbCritical, "REGISTER FIRST..."
Exit Sub
Else
Unload Me
Form6.Show
End If
End Sub
Private Sub cmdexit_Click()
Unload Me
End Sub
Private Sub lblsign_Click()
Form16.Show
Unload Me
End Sub