cs_lea75
Messages postés54Date d'inscriptionvendredi 30 juillet 2004StatutMembreDernière intervention28 août 2004
-
19 août 2004 à 10:45
cs_lea75
Messages postés54Date d'inscriptionvendredi 30 juillet 2004StatutMembreDernière intervention28 août 2004
-
19 août 2004 à 11:17
Bonjour à tous,
J'ai une erreur 91 dans ma classe Clslog2
Option Explicit
Dim vlog As String
Dim vpwd As String
Public Property Get pwd() As String
pwd = vpwd
End Property
Public Property Let pwd(ByVal vNewValue As String)
vpwd = vNewValue
End Property
Public Property Get log() As String
log = vlog
End Property
Public Property Let log(ByVal vNewValue As String)
vlog = vNewValue
End Property
Public Function verif() As Integer
Dim req As String
Dim rst As Recordset
req = "select(ftest('" & log & "','" & pwd & "'))"
Set rst = monctrldb.exec_requete(req) //Cette ligne il bloque//
rep = rst.Fields(0)
End Function
monctrldb vient de ma classe Ctrldb
Option Explicit
Dim con As Connection
Dim rst As Recordset
Private Sub Class_Initialize()
Set con = New Connection
con.Provider = "MSDASQL"
con.Open "DSN=aeroclub_odbc"
End Sub
Private Sub Class_Terminate()
con.Close
End Sub
Public Function exec_requete(ByVal req As String) As Recordset
Set rst = con.Execute(req)
Set exec_requete = rst
End Function
et j'appelle la fonction verif de ma classe Clslog2 dans une autre classe appellée Ctrllog
Option Explicit
Dim monlog2 As Clslog2
Public Sub verif(login As String, password As String)
Set monlog2 = New Clslog2
With monlog2
.log = login
.pwd = password
.verif
If rep = 1 Then
MsgBox "Vous etes un membre"
ElseIf rep = 3 Then
MsgBox "Vous etes un employe"
ElseIf rep = 2 Then
MsgBox "Vous etes un technicien"
End If
End With
End Sub
et je renvois un chiffre suivant ma fonction ftest
Le formulaire dans lequel j'encode s'appelle frmlog où je vais tester si il s'agit d'un membre ou d'un employé ou d'un technicien:
frmlog:
Private Sub cmdlog_Click()
If Len(Txtlog.Text) < 11 And Len(Txtpwd.Text) < 11 Then
monctrllog.verif Txtlog.Text, Txtpwd.Text
frmAeroclubmemb.Show
Unload Me
Else
MsgBox "Code erroné ", vbExclamation
End If
End Sub
Je dois faire chaque fois la même erreur car j'ai le même problème dans tous mes formulaires.
Quelqu'un pourrait m'aider ???
Merci beaucoup car je suis nulle part