home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form frmLogin
- BorderStyle = 3 'Fixed Double
- Caption = "Login"
- ClientHeight = 1980
- ClientLeft = 2550
- ClientTop = 3330
- ClientWidth = 2820
- Height = 2385
- HelpContextID = 2016133
- Icon = "LOGINFRM.frx":0000
- Left = 2490
- LinkTopic = "Form1"
- LockControls = -1 'True
- ScaleHeight = 1980
- ScaleWidth = 2820
- Top = 2985
- Width = 2940
- Begin VB.CommandButton cmdCancel
- Cancel = -1 'True
- Caption = "&Cancel"
- Height = 375
- Left = 1440
- TabIndex = 3
- Top = 1440
- Width = 1215
- End
- Begin VB.CommandButton cmdOK
- Caption = "&OK"
- Default = -1 'True
- Height = 375
- Left = 120
- TabIndex = 2
- Top = 1440
- Width = 1215
- End
- Begin VB.TextBox txtPassword
- Height = 285
- Left = 120
- PasswordChar = "*"
- TabIndex = 1
- Top = 960
- Width = 2535
- End
- Begin VB.TextBox txtLoginName
- Height = 285
- Left = 120
- TabIndex = 0
- Top = 360
- Width = 2535
- End
- Begin VB.Label lblLabels
- AutoSize = -1 'True
- Caption = "Password: "
- Height = 195
- Index = 1
- Left = 120
- TabIndex = 5
- Top = 720
- Width = 780
- End
- Begin VB.Label lblLabels
- AutoSize = -1 'True
- Caption = "Login Name: "
- Height = 195
- Index = 0
- Left = 120
- TabIndex = 4
- Top = 120
- Width = 945
- End
- Attribute VB_Name = "frmLogin"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- 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_Load()
- CenterMe Me, gnMDIFORM
- End Sub
- Private Sub cmdOK_Click()
- On Error GoTo OKErr
- Dim wsp As Workspace
- Dim sTmp As String
- 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()
- SendKeys "+{end}"
- End Sub
- Private Sub txtPassword_GotFocus()
- SendKeys "+{end}"
- End Sub
-