ORIGINAL SOURCE CODE FOR Loginfrm.frm
Made on Tuesday, Apr 8, 2003 at 9:43 AM
Option Explicit
'>>>>>>>>>>>>>>>>>>>>>>>>
'ResMe Converted To A Property: Const FORMCAPTION = "Login"
'ResMe Converted To A Property: Const BUTTON1 = "&OK"
'ResMe Converted To A Property: Const BUTTON2 = "&Cancel"
'ResMe Converted To A Property: Const Label1 = "Login Name:"
'ResMe Converted To A Property: Const Label2 = "Password:"
'>>>>>>>>>>>>>>>>>>>>>>>>
Private Sub cmdCancel_Click()
On Error Resume Next
'if the global workspace object is not set, then we must be
'opening the app so we should end
If gwsMainWS Is Nothing Then
End
Else
'just unload since the workspace is already set
Unload Me
End If
End Sub
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyF1 And Shift = 0 Then
DisplayTopic 2016133
End If
End Sub
Private Sub Form_Load()
'ResMe autogenerated line of code to call the initialization routine that was automatically generated.
Call frmLogin_Auto_Init
Me.Caption = FORMCAPTION
cmdOK.Caption = BUTTON1
cmdCancel.Caption = BUTTON2
lblLabels(0).Caption = Label1
lblLabels(1).Caption = Label2
End Sub
Private Sub cmdOK_Click()
On Error GoTo OKErr
Dim wsp As Workspace
Dim sTmp As String
If Not gwsMainWS Is Nothing Then
If UCase(txtLoginName.Text) = UCase(gwsMainWS.UserName) Then
'same as current login name
Unload Me
Exit Sub
End If
End If
'set the new login name
DBEngine.DefaultUser = txtLoginName.Text
DBEngine.DefaultPassword = txtPassword.Text
Set wsp = DBEngine.CreateWorkspace("MainWS", txtLoginName.Text, txtPassword.Text)
'must have been successful so set the gswMainWS
Set gwsMainWS = wsp
Unload Me
Exit Sub
OKErr:
MsgBox Error
txtLoginName.SetFocus
Exit Sub 'give them another chance
End Sub
Private Sub txtLoginName_GotFocus()
txtLoginName.SelStart = 0
txtLoginName.SelLength = Len(txtLoginName.Text)
End Sub
Private Sub txtPassword_GotFocus()
txtPassword.SelStart = 0
txtPassword.SelLength = Len(txtPassword.Text)
End Sub
'*********************************************************************************
'** This Section Of Code Was Automatically Generated By ResMe **
'** **
'** String assignments to Constants have been converted to read-only properties **
'*********************************************************************************
'This was: Const FORMCAPTION = "Login"
Property Get FORMCAPTION As String
FORMCAPTION = "Login"
End Property
'This was: Const BUTTON1 = "&OK"
Property Get BUTTON1 As String
BUTTON1 = "&OK"
End Property
'This was: Const BUTTON2 = "&Cancel"
Property Get BUTTON2 As String
BUTTON2 = "&Cancel"
End Property
'This was: Const Label1 = "Login Name:"
Property Get Label1 As String
Label1 = "Login Name:"
End Property
'This was: Const Label2 = "Password:"
Property Get Label2 As String
Label2 = "Password:"
End Property
Private Sub frmLogin_Auto_Init()
'This routine initializes all User Interface control properties on frmLogin.
'This section of code was automatically generated by the ResMe String Extraction Utility.
Me.Caption = "Login"
cmdCancel.Caption = "&Cancel"
cmdOK.Caption = "&OK"
lblLabels(1).Caption = "Password: "
lblLabels(0).Caption = "Login Name: "
End Sub