home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form frmObjLogin
- BorderStyle = 3 'Fixed Double
- Caption = "Oracle Login"
- ClientHeight = 2790
- ClientLeft = 2235
- ClientTop = 2970
- ClientWidth = 4050
- Height = 3195
- Left = 2175
- LinkTopic = "Form4"
- ScaleHeight = 2790
- ScaleWidth = 4050
- Top = 2625
- Width = 4170
- Begin TextBox txtODBCDatabaseName
- Height = 285
- Left = 1680
- TabIndex = 3
- Text = "ODBCExampleDb"
- Top = 1680
- Width = 2295
- End
- Begin CommandButton cmdCancel
- Caption = "Cancel"
- Height = 495
- Left = 2280
- TabIndex = 5
- Top = 2160
- Width = 1215
- End
- Begin CommandButton cmdOK
- Caption = "OK"
- Default = -1 'True
- Height = 495
- Left = 480
- TabIndex = 4
- Top = 2160
- Width = 1215
- End
- Begin TextBox txtDatabaseName
- Height = 285
- Left = 1680
- TabIndex = 2
- Text = "ExampleDb"
- Top = 1200
- Width = 2295
- End
- Begin TextBox txtPassword
- Height = 285
- Left = 1680
- PasswordChar = "*"
- TabIndex = 1
- Text = "tiger"
- Top = 720
- Width = 2295
- End
- Begin TextBox txtUserName
- Height = 285
- Left = 1680
- TabIndex = 0
- Text = "Scott"
- Top = 240
- Width = 2295
- End
- Begin Label Label4
- Alignment = 1 'Right Justify
- AutoSize = -1 'True
- Caption = "ODBC Database:"
- Height = 195
- Left = 120
- TabIndex = 9
- Top = 1680
- Width = 1455
- End
- Begin Label Label3
- Alignment = 1 'Right Justify
- AutoSize = -1 'True
- Caption = "Database:"
- Height = 195
- Left = 660
- TabIndex = 8
- Top = 1200
- Width = 885
- End
- Begin Label Label2
- Alignment = 1 'Right Justify
- AutoSize = -1 'True
- Caption = "Password:"
- Height = 195
- Left = 720
- TabIndex = 7
- Top = 720
- Width = 885
- End
- Begin Label Label1
- Alignment = 1 'Right Justify
- AutoSize = -1 'True
- Caption = "User Name:"
- Height = 195
- Left = 600
- TabIndex = 6
- Top = 240
- Width = 1005
- End
- Option Explicit
- Sub cmdCancel_Click ()
- Unload frmObjLogin
- End Sub
- Sub cmdOK_Click ()
- If txtUserName.Text <> "" Then
- UserName$ = txtUserName.Text
- Password$ = txtPassword.Text
- DatabaseName$ = txtDatabaseName.Text
- ODBCDatabaseName$ = txtODBCDatabaseName.Text
- Connect$ = UserName$ + "/" + Password$
- ODBCConnect$ = "ODBC;DSN=" & ODBCDatabaseName$ & ";UID=" & UserName$ & ";PWD=" & Password$ & ";"
- On Error GoTo NoOraConnection
- Set OraSession = Nothing
- Set OraSession = CreateObject("OracleInProcServer.XOraSession")
- Set OraDatabase = Nothing
- Set OraDatabase = OraSession.OpenDatabase(DatabaseName$, Connect$, 0&)
- On Error GoTo NoODBCConnection
- Set MSDatabase = Nothing
- Set MSDatabase = OpenDatabase("", False, False, ODBCConnect$)
- OraSession.LastServerErrReset
- frmObjLogin.Hide
- frmObjTest.Show
- End If
- Exit Sub
- NoOraConnection:
- frmObjOraError.Show MODAL
- NoODBCConnection:
- End Sub
- Sub Form_Load ()
- Call CenterForm(frmObjLogin)
- End Sub
- Sub txtDatabaseName_GotFocus ()
- txtDatabaseName.SelStart = 0
- txtDatabaseName.SelLength = Len(txtDatabaseName.Text)
- End Sub
- Sub txtODBCDatabaseName_GotFocus ()
- txtODBCDatabaseName.SelStart = 0
- txtODBCDatabaseName.SelLength = Len(txtODBCDatabaseName.Text)
- End Sub
- Sub txtPassword_GotFocus ()
- txtPassword.SelStart = 0
- txtPassword.SelLength = Len(txtPassword.Text)
- End Sub
- Sub txtUsername_GotFocus ()
- txtUserName.SelStart = 0
- txtUserName.SelLength = Len(txtUserName.Text)
- End Sub
-