home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 February / PCWK0296.iso / po7_win / object10 / vbslogin.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-10-31  |  3.6 KB  |  125 lines

  1. VERSION 2.00
  2. Begin Form frmOraLogin 
  3.    BorderStyle     =   3  'Fixed Double
  4.    Caption         =   "VB*SQL Login"
  5.    ClientHeight    =   2430
  6.    ClientLeft      =   2460
  7.    ClientTop       =   3045
  8.    ClientWidth     =   3870
  9.    Height          =   2835
  10.    Left            =   2400
  11.    LinkTopic       =   "Form4"
  12.    MaxButton       =   0   'False
  13.    ScaleHeight     =   2430
  14.    ScaleWidth      =   3870
  15.    Top             =   2700
  16.    Width           =   3990
  17.    Begin CommandButton cmdCancel 
  18.       Caption         =   "Cancel"
  19.       Height          =   495
  20.       Left            =   2280
  21.       TabIndex        =   4
  22.       Top             =   1680
  23.       Width           =   1215
  24.    End
  25.    Begin CommandButton cmdOK 
  26.       Caption         =   "OK"
  27.       Default         =   -1  'True
  28.       Height          =   495
  29.       Left            =   480
  30.       TabIndex        =   3
  31.       Top             =   1680
  32.       Width           =   1215
  33.    End
  34.    Begin TextBox txtDatabaseName 
  35.       Height          =   285
  36.       Left            =   1320
  37.       TabIndex        =   2
  38.       Text            =   "ExampleDb"
  39.       Top             =   1200
  40.       Width           =   2295
  41.    End
  42.    Begin TextBox txtPassword 
  43.       Height          =   285
  44.       Left            =   1320
  45.       PasswordChar    =   "*"
  46.       TabIndex        =   1
  47.       Text            =   "tiger"
  48.       Top             =   720
  49.       Width           =   2295
  50.    End
  51.    Begin TextBox txtUserName 
  52.       Height          =   285
  53.       Left            =   1320
  54.       TabIndex        =   0
  55.       Text            =   "Scott"
  56.       Top             =   240
  57.       Width           =   2295
  58.    End
  59.    Begin Label Label3 
  60.       Alignment       =   1  'Right Justify
  61.       AutoSize        =   -1  'True
  62.       Caption         =   "Database:"
  63.       Height          =   195
  64.       Left            =   300
  65.       TabIndex        =   7
  66.       Top             =   1200
  67.       Width           =   885
  68.    End
  69.    Begin Label Label2 
  70.       Alignment       =   1  'Right Justify
  71.       AutoSize        =   -1  'True
  72.       Caption         =   "Password:"
  73.       Height          =   195
  74.       Left            =   360
  75.       TabIndex        =   6
  76.       Top             =   720
  77.       Width           =   885
  78.    End
  79.    Begin Label Label1 
  80.       Alignment       =   1  'Right Justify
  81.       AutoSize        =   -1  'True
  82.       Caption         =   "User Name:"
  83.       Height          =   195
  84.       Left            =   240
  85.       TabIndex        =   5
  86.       Top             =   240
  87.       Width           =   1005
  88.    End
  89. Option Explicit
  90. Sub cmdCancel_Click ()
  91.  Unload frmOraLogin
  92. End Sub
  93. Sub cmdOK_Click ()
  94.  If txtUserName.Text <> "" Then
  95.   UserName$ = txtUserName.Text
  96.   Password$ = txtPassword.Text
  97.   DatabaseName$ = txtDatabaseName.Text
  98.   Connect$ = UserName$ + "/" + Password$
  99.   On Error GoTo NoOraConnection
  100.  'Session and Database are declared global in vbsql.bas
  101.   Set OraSession = CreateObject("OracleInProcServer.XOraSession")
  102.   Set OraDatabase = OraSession.OpenDatabase(DatabaseName$, Connect$, 0&)
  103.   frmOraLogin.Hide
  104.   frmVBSQL.Show
  105.  End If
  106. Exit Sub
  107. NoOraConnection:
  108.  frmOraError.Show MODAL
  109. End Sub
  110. Sub Form_Load ()
  111.  Call CenterForm(frmOraLogin)
  112. End Sub
  113. Sub txtDatabaseName_GotFocus ()
  114.  txtDatabaseName.SelStart = 0
  115.  txtDatabaseName.SelLength = Len(txtDatabaseName.Text)
  116. End Sub
  117. Sub txtPassword_GotFocus ()
  118.  txtPassword.SelStart = 0
  119.  txtPassword.SelLength = Len(txtPassword.Text)
  120. End Sub
  121. Sub txtUsername_GotFocus ()
  122.  txtUserName.SelStart = 0
  123.  txtUserName.SelLength = Len(txtUserName.Text)
  124. End Sub
  125.