VBSample project - Technical -frmLogin - Controls
Controls of frmLogin


cmdCancel


private sub cmdCancel_Click( )


General information

Full name cmdCancel.cmdCancel_Click
Access private
Overload of  

Source code

Private  Sub cmdCancel_Click()
    OK =  False
    Me.Hide
End  Sub

Referenced classes

Full name
frmLogin

Referenced properties

Full name Scope
frmLogin.OK attribute



cmdOK

private sub cmdOK_Click( )


General information

Full name cmdOK.cmdOK_Click
Access private
Overload of  
Purpose Authenticates the user and load the security informations from the database.
Comment Visual Guard authenticates the user.
Prototype private sub cmdOK_Click( )
History NOVALYS - 2001/10/20 - Creation

Local variables

intRet Integer

Source code

Private  Sub cmdOK_Click()
'************************************************************************
' Purpose : Authenticates the user and load the security informations from the database.
' Comment : Visual Guard authenticates the user.
' History : NOVALYS - 2001/10/20 - Creation
'************************************************************************
        
Dim intRet As  Integer
On Error GoTo ErrorHandler
OK =  True
Me.Hide
            
Set db =  New Connection
db.CursorLocation = adUseClient
db.Open  "PROVIDER=MSDASQL;dsn=Visual Guard Sample DB;uid=dba;pwd=sql;"
If MyVisualGuard.SetConnection(db) <  0  Then
Exit  Sub
End  If
'=======================================================
' Authenticates the user and loads security informations
'=======================================================
intRet = MyVisualGuard.VerifyUser(txtUserName.Text, txtPassword.Text)
If intRet <  0  Then
  db.Disconnect
  Me.OK =  False
  Me.Show vbModal
  Exit  Sub
End  If
'=======================================================
    
Exit  Sub
ErrorHandler:
Select  Case Err.Number
        
     Case  Else
        
        MsgBox Err.Description, ,  "Visual Guard : Login"
        Me.OK =  False
        
End  Select
    
End  Sub

Functions and events referenced

Full name Owners
Connection.Disconnect Connection
MyVG.VerifyUser MyVG
MyVG.SetConnection MyVG
Connection.Open Connection

Referenced classes

Full name
Connection
frmLogin

Referenced properties

Full name Scope
cmdOK.cmdOK_Click.intRet local
ModMain.MyVisualGuard attribute
Connection.CursorLocation attribute
ModMain.db attribute
frmLogin.OK attribute




Document created on Wednesday 20 March 2002 at 09:57 by Visual Expert