Kod:
Option Compare Database
Option Explicit
Public conn As ADODB.Connection
Public rst As ADODB.Recordset
Private Sub Form_Load()
Set conn = CurrentProject.Connection
Set rst = New ADODB.Recordset
Me.error.Visible = False
End Sub
Private Sub iesire_Click()
Application.Quit
End Sub
Private Sub intrare_Click()
If IsNull(Me.nume) Or Me.nume = "" Then
Me.error.Visible = True
MsgBox "Greşit nume "
Error_ = True
End If
If IsNull(Me.parola) Or Me.parola = "" Then
Me.error.Visible = True
MsgBox "Greşit parola "
Error_ = True
End If
If Error_ = False Then
strSql = "SELECT DISTINCT nume FROM `agentii` WHERE nume=" & Me.nume & " and parola=" & Me.parola
rst.Open strSql, CurrentProject.Connection, adOpenStatic, adLockReadOnly
If rst.RecordCount = 1 Then
MsgBox "ok"
Else
MsgBox ":("
End If
Me.error.Visible = False
End If
End Sub
acces ve vbde yeniyimde [/align]