home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1996 February
/
PCWK0296.iso
/
po7_win
/
object10
/
vbslogin.frm
< prev
next >
Wrap
Text File
|
1994-10-31
|
4KB
|
149 lines
VERSION 2.00
Begin Form frmOraLogin
BorderStyle = 3 'Fixed Double
Caption = "VB*SQL Login"
ClientHeight = 2430
ClientLeft = 2460
ClientTop = 3045
ClientWidth = 3870
Height = 2835
Left = 2400
LinkTopic = "Form4"
MaxButton = 0 'False
ScaleHeight = 2430
ScaleWidth = 3870
Top = 2700
Width = 3990
Begin CommandButton cmdCancel
Caption = "Cancel"
Height = 495
Left = 2280
TabIndex = 4
Top = 1680
Width = 1215
End
Begin CommandButton cmdOK
Caption = "OK"
Default = -1 'True
Height = 495
Left = 480
TabIndex = 3
Top = 1680
Width = 1215
End
Begin TextBox txtDatabaseName
Height = 285
Left = 1320
TabIndex = 2
Text = "ExampleDb"
Top = 1200
Width = 2295
End
Begin TextBox txtPassword
Height = 285
Left = 1320
PasswordChar = "*"
TabIndex = 1
Text = "tiger"
Top = 720
Width = 2295
End
Begin TextBox txtUserName
Height = 285
Left = 1320
TabIndex = 0
Text = "Scott"
Top = 240
Width = 2295
End
Begin Label Label3
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "Database:"
Height = 195
Left = 300
TabIndex = 7
Top = 1200
Width = 885
End
Begin Label Label2
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "Password:"
Height = 195
Left = 360
TabIndex = 6
Top = 720
Width = 885
End
Begin Label Label1
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "User Name:"
Height = 195
Left = 240
TabIndex = 5
Top = 240
Width = 1005
End
End
Option Explicit
Sub cmdCancel_Click ()
Unload frmOraLogin
End
End Sub
Sub cmdOK_Click ()
If txtUserName.Text <> "" Then
UserName$ = txtUserName.Text
Password$ = txtPassword.Text
DatabaseName$ = txtDatabaseName.Text
Connect$ = UserName$ + "/" + Password$
On Error GoTo NoOraConnection
'Session and Database are declared global in vbsql.bas
Set OraSession = CreateObject("OracleInProcServer.XOraSession")
Set OraDatabase = OraSession.OpenDatabase(DatabaseName$, Connect$, 0&)
frmOraLogin.Hide
frmVBSQL.Show
End If
Exit Sub
NoOraConnection:
frmOraError.Show MODAL
End
End Sub
Sub Form_Load ()
Call CenterForm(frmOraLogin)
End Sub
Sub txtDatabaseName_GotFocus ()
txtDatabaseName.SelStart = 0
txtDatabaseName.SelLength = Len(txtDatabaseName.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