home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 February / PCWK0296.iso / po7_win / object10 / vbslogin.frm < prev    next >
Text File  |  1994-10-31  |  4KB  |  149 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. End
  90. Option Explicit
  91.  
  92. Sub cmdCancel_Click ()
  93.  Unload frmOraLogin
  94.  End
  95. End Sub
  96.  
  97. Sub cmdOK_Click ()
  98.  
  99.  
  100.  If txtUserName.Text <> "" Then
  101.   UserName$ = txtUserName.Text
  102.   Password$ = txtPassword.Text
  103.   DatabaseName$ = txtDatabaseName.Text
  104.   Connect$ = UserName$ + "/" + Password$
  105.  
  106.   On Error GoTo NoOraConnection
  107.  'Session and Database are declared global in vbsql.bas
  108.   Set OraSession = CreateObject("OracleInProcServer.XOraSession")
  109.   Set OraDatabase = OraSession.OpenDatabase(DatabaseName$, Connect$, 0&)
  110.  
  111.   frmOraLogin.Hide
  112.   frmVBSQL.Show
  113.  End If
  114.  
  115. Exit Sub
  116. NoOraConnection:
  117.  frmOraError.Show MODAL
  118.  End
  119.  
  120. End Sub
  121.  
  122. Sub Form_Load ()
  123.  
  124.  Call CenterForm(frmOraLogin)
  125.  
  126. End Sub
  127.  
  128. Sub txtDatabaseName_GotFocus ()
  129.  
  130.  txtDatabaseName.SelStart = 0
  131.  txtDatabaseName.SelLength = Len(txtDatabaseName.Text)
  132.  
  133. End Sub
  134.  
  135. Sub txtPassword_GotFocus ()
  136.  
  137.  txtPassword.SelStart = 0
  138.  txtPassword.SelLength = Len(txtPassword.Text)
  139.  
  140. End Sub
  141.  
  142. Sub txtUsername_GotFocus ()
  143.  
  144.  txtUserName.SelStart = 0
  145.  txtUserName.SelLength = Len(txtUserName.Text)
  146.  
  147. End Sub
  148.  
  149.