home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 February / PCWK0296.iso / po7_win / object10 / login.frm < prev    next >
Text File  |  1994-11-20  |  4KB  |  142 lines

  1. VERSION 2.00
  2. Begin Form frmLogin 
  3.    BorderStyle     =   3  'Fixed Double
  4.    Caption         =   "Login Test"
  5.    ClientHeight    =   2370
  6.    ClientLeft      =   2910
  7.    ClientTop       =   3555
  8.    ClientWidth     =   4050
  9.    Height          =   2775
  10.    Left            =   2850
  11.    LinkTopic       =   "Form4"
  12.    ScaleHeight     =   2370
  13.    ScaleWidth      =   4050
  14.    Top             =   3210
  15.    Width           =   4170
  16.    Begin CommandButton Cancel 
  17.       Caption         =   "Cancel"
  18.       Height          =   495
  19.       Left            =   2280
  20.       TabIndex        =   7
  21.       Top             =   1680
  22.       Width           =   1215
  23.    End
  24.    Begin CommandButton ok 
  25.       Caption         =   "OK"
  26.       Default         =   -1  'True
  27.       Height          =   495
  28.       Left            =   480
  29.       TabIndex        =   6
  30.       Top             =   1680
  31.       Width           =   1215
  32.    End
  33.    Begin TextBox lDatabaseName 
  34.       Height          =   285
  35.       Left            =   1440
  36.       TabIndex        =   2
  37.       Text            =   "ExampleDb"
  38.       Top             =   1200
  39.       Width           =   2295
  40.    End
  41.    Begin TextBox lPassword 
  42.       Height          =   285
  43.       Left            =   1440
  44.       PasswordChar    =   "*"
  45.       TabIndex        =   1
  46.       Text            =   "tiger"
  47.       Top             =   720
  48.       Width           =   2295
  49.    End
  50.    Begin TextBox lUsername 
  51.       Height          =   285
  52.       Left            =   1440
  53.       TabIndex        =   0
  54.       Text            =   "Scott"
  55.       Top             =   240
  56.       Width           =   2295
  57.    End
  58.    Begin Label Label3 
  59.       Alignment       =   1  'Right Justify
  60.       AutoSize        =   -1  'True
  61.       Caption         =   "Database"
  62.       Height          =   195
  63.       Left            =   480
  64.       TabIndex        =   5
  65.       Top             =   1200
  66.       Width           =   825
  67.    End
  68.    Begin Label Label2 
  69.       Alignment       =   1  'Right Justify
  70.       AutoSize        =   -1  'True
  71.       Caption         =   "Password:"
  72.       Height          =   195
  73.       Left            =   480
  74.       TabIndex        =   4
  75.       Top             =   720
  76.       Width           =   885
  77.    End
  78.    Begin Label Label1 
  79.       Alignment       =   1  'Right Justify
  80.       AutoSize        =   -1  'True
  81.       Caption         =   "User Name:"
  82.       Height          =   195
  83.       Left            =   240
  84.       TabIndex        =   3
  85.       Top             =   240
  86.       Width           =   1005
  87.    End
  88. End
  89. Option Explicit
  90.  
  91. Sub Cancel_Click ()
  92.  Unload frmLogin
  93.  End
  94. End Sub
  95.  
  96. Sub Form_Load ()
  97.  
  98.  Call CenterForm(frmLogin)
  99.  
  100. End Sub
  101.  
  102. Sub lDatabaseName_GotFocus ()
  103.  
  104.  lDatabaseName.SelStart = 0
  105.  lDatabaseName.SelLength = Len(lDatabaseName.Text)
  106.  
  107. End Sub
  108.  
  109. Sub lPassword_GotFocus ()
  110.  
  111.  lPassword.SelStart = 0
  112.  lPassword.SelLength = Len(lPassword.Text)
  113.  
  114. End Sub
  115.  
  116. Sub lUsername_GotFocus ()
  117.  
  118.  lUserName.SelStart = 0
  119.  lUserName.SelLength = Len(lUserName.Text)
  120.  
  121. End Sub
  122.  
  123. Sub OK_Click ()
  124.  
  125.  If lUserName.Text <> "" Then
  126.   UserName$ = lUserName.Text
  127.   Password$ = lPassword.Text
  128.   DatabaseName$ = lDatabaseName.Text
  129.   Connect$ = UserName$ + "/" + Password$
  130.  
  131.  On Error GoTo NoOraConnection
  132.  Set OraSession = CreateObject("OracleInProcServer.XOraSession")
  133.  Set OraDatabase = OraSession.DbOpenDatabase(DatabaseName$, Connect$, 0&)
  134.  
  135. NoOraConnection:
  136.  frmLogOraError.Show MODAL
  137.  End
  138.  
  139.  End If
  140. End Sub
  141.  
  142.