MODIFIED SOURCE CODE FOR Loginfrm.frm

Made on Tuesday, Apr 8, 2003 at 9:43 AM

http://www.resourcemining.com

Loginfrm.frm contained 9 resource strings and 2 non-user interface strings.

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
    'WAS: FORMCAPTION = "Login"
    FORMCAPTION = LoadResString(S312_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
    'WAS: BUTTON2 = "&Cancel"
    BUTTON2 = LoadResString(S84_Cancel)

End Property

'This was: Const Label1 = "Login Name:"
Property Get Label1 As String
    'WAS: Label1 = "Login Name:"
    Label1 = LoadResString(S313_Login_Name)

End Property

'This was: Const Label2 = "Password:"
Property Get Label2 As String
    'WAS: Label2 = "Password:"
    Label2 = LoadResString(S408_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.
    'WAS: Me.Caption = "Login"
    Me.Caption = LoadResString(S312_Login)

    'WAS: cmdCancel.Caption = "&Cancel"
    cmdCancel.Caption = LoadResString(S84_Cancel)

    'WAS: cmdOK.Caption = "&OK"
    cmdOK.Caption = LoadResString(S355_OK)

    'WAS: lblLabels(1).Caption = "Password: "
    lblLabels(1).Caption = LoadResString(S409_Password)

    'WAS: lblLabels(0).Caption = "Login Name: "
    lblLabels(0).Caption = LoadResString(S314_Login_Name)

End Sub