Hii all this is my lab program (vb program to validate the user name and password from the database and display the appropriate message) use Data control
i getting Run- time error '-2147467259 (80004005)' Could not find file 'C:\Program Files (x86)Microsoft Visual Studio\VB98\Account.mdb
My code is
Dim rs As New ADODB.Recordset
Dim conn As New ADODB.Connection
Private Sub cmdexit_Click()
MsgBox "do u really want to exit", vbInformation + vbOKOnly, "login"
If vbOK Then
End
End If
End Sub
Private Sub cmdlogin_Click()
If Text1.Text = "" Then
MsgBox "enter the username", vbInformation + vbOKOnly, "login"
Text1.SetFocus
Exit Sub
End If
If Text2.Text = "" Then
MsgBox "enter the password", vbInformation + vbOKOnly, "login"
Text2.SetFocus
Exit Sub
End If
If Text1.Text <> "" And Text2.Text <> "" Then
If rs.State = 1 Then
rs.Close
Else
rs.Open "select * from login where username='" & Text1 & "' and password= '" & Text2 & "' ", conn, adOpenDynamic, adLockOptimistic, adCmdText
End If
If rs.EOF = True Then
MsgBox "invalid username and password", vbCritical + vbOKOnly, "login"
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
Else
MsgBox "username and password correct", vbInformation + vbOKOnly, "login"
End If
End If
End Sub
Private Sub Form_Load()
conn.Open "provider=microsoft.jet.oledb.4.0;data source=" & App.Path & "\ Account.mdb;persist security info = false"
End Sub