Krijimi i Bazes per Password ne Vizual Basic
Private Sub cmdBegin_Click()
On Error Resume Next
With frmReg.Data1
.DatabaseName = App.Path & "\database.mdb"
.RecordSource = "reg"
.Refresh
End With
If Text1.Text = "" Then
Text1.SetFocus
ElseIf Text2.Text = "" Then
Text2.SetFocus
ElseIf Text1.Text <> frmReg.Data1.Recordset.Fields("User") Then
MsgBox "You can not begin this software with this USER ID. Please try again..", vbCritical
Text1.Text = ""
Text1.SetFocus
ElseIf Text2.Text <> frmReg.Data1.Recordset.Fields("Password") Then
MsgBox "You entered an invalid password for " & Text1.Text & " .", vbCritical
Text2.Text = ""
Text2.SetFocus
Else
Me.Hide
mdiMain.Show
End If
frmReg.Data1.Database.Close
End Sub
Private Sub cmdQuit_Click()
Unload Me
End
End Sub
Private Sub Form_Load()
On Error Resume Next
Screen.MousePointer = vbNormal
Label3.Caption = frmReg.Data1.Recordset.Fields("Organization")
End Sub
krijimi i paswortit ne database