home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 February / PCWK0296.iso / po7_win / object10 / objlogin.frm < prev    next >
Text File  |  1994-10-29  |  5KB  |  186 lines

  1. VERSION 2.00
  2. Begin Form frmObjLogin 
  3.    BorderStyle     =   3  'Fixed Double
  4.    Caption         =   "Oracle Login"
  5.    ClientHeight    =   2790
  6.    ClientLeft      =   2235
  7.    ClientTop       =   2970
  8.    ClientWidth     =   4050
  9.    Height          =   3195
  10.    Left            =   2175
  11.    LinkTopic       =   "Form4"
  12.    ScaleHeight     =   2790
  13.    ScaleWidth      =   4050
  14.    Top             =   2625
  15.    Width           =   4170
  16.    Begin TextBox txtODBCDatabaseName 
  17.       Height          =   285
  18.       Left            =   1680
  19.       TabIndex        =   3
  20.       Text            =   "ODBCExampleDb"
  21.       Top             =   1680
  22.       Width           =   2295
  23.    End
  24.    Begin CommandButton cmdCancel 
  25.       Caption         =   "Cancel"
  26.       Height          =   495
  27.       Left            =   2280
  28.       TabIndex        =   5
  29.       Top             =   2160
  30.       Width           =   1215
  31.    End
  32.    Begin CommandButton cmdOK 
  33.       Caption         =   "OK"
  34.       Default         =   -1  'True
  35.       Height          =   495
  36.       Left            =   480
  37.       TabIndex        =   4
  38.       Top             =   2160
  39.       Width           =   1215
  40.    End
  41.    Begin TextBox txtDatabaseName 
  42.       Height          =   285
  43.       Left            =   1680
  44.       TabIndex        =   2
  45.       Text            =   "ExampleDb"
  46.       Top             =   1200
  47.       Width           =   2295
  48.    End
  49.    Begin TextBox txtPassword 
  50.       Height          =   285
  51.       Left            =   1680
  52.       PasswordChar    =   "*"
  53.       TabIndex        =   1
  54.       Text            =   "tiger"
  55.       Top             =   720
  56.       Width           =   2295
  57.    End
  58.    Begin TextBox txtUserName 
  59.       Height          =   285
  60.       Left            =   1680
  61.       TabIndex        =   0
  62.       Text            =   "Scott"
  63.       Top             =   240
  64.       Width           =   2295
  65.    End
  66.    Begin Label Label4 
  67.       Alignment       =   1  'Right Justify
  68.       AutoSize        =   -1  'True
  69.       Caption         =   "ODBC Database:"
  70.       Height          =   195
  71.       Left            =   120
  72.       TabIndex        =   9
  73.       Top             =   1680
  74.       Width           =   1455
  75.    End
  76.    Begin Label Label3 
  77.       Alignment       =   1  'Right Justify
  78.       AutoSize        =   -1  'True
  79.       Caption         =   "Database:"
  80.       Height          =   195
  81.       Left            =   660
  82.       TabIndex        =   8
  83.       Top             =   1200
  84.       Width           =   885
  85.    End
  86.    Begin Label Label2 
  87.       Alignment       =   1  'Right Justify
  88.       AutoSize        =   -1  'True
  89.       Caption         =   "Password:"
  90.       Height          =   195
  91.       Left            =   720
  92.       TabIndex        =   7
  93.       Top             =   720
  94.       Width           =   885
  95.    End
  96.    Begin Label Label1 
  97.       Alignment       =   1  'Right Justify
  98.       AutoSize        =   -1  'True
  99.       Caption         =   "User Name:"
  100.       Height          =   195
  101.       Left            =   600
  102.       TabIndex        =   6
  103.       Top             =   240
  104.       Width           =   1005
  105.    End
  106. End
  107. Option Explicit
  108.  
  109. Sub cmdCancel_Click ()
  110.  Unload frmObjLogin
  111.  End
  112. End Sub
  113.  
  114. Sub cmdOK_Click ()
  115.  
  116.  If txtUserName.Text <> "" Then
  117.   UserName$ = txtUserName.Text
  118.   Password$ = txtPassword.Text
  119.   DatabaseName$ = txtDatabaseName.Text
  120.   ODBCDatabaseName$ = txtODBCDatabaseName.Text
  121.   Connect$ = UserName$ + "/" + Password$
  122.   ODBCConnect$ = "ODBC;DSN=" & ODBCDatabaseName$ & ";UID=" & UserName$ & ";PWD=" & Password$ & ";"
  123.  
  124.   On Error GoTo NoOraConnection
  125.   Set OraSession = Nothing
  126.   Set OraSession = CreateObject("OracleInProcServer.XOraSession")
  127.  
  128.   Set OraDatabase = Nothing
  129.   Set OraDatabase = OraSession.OpenDatabase(DatabaseName$, Connect$, 0&)
  130.  
  131.   On Error GoTo NoODBCConnection
  132.   Set MSDatabase = Nothing
  133.   Set MSDatabase = OpenDatabase("", False, False, ODBCConnect$)
  134.   
  135.   OraSession.LastServerErrReset
  136.  
  137.   frmObjLogin.Hide
  138.   frmObjTest.Show
  139.  End If
  140.  
  141. Exit Sub
  142.  
  143. NoOraConnection:
  144.  frmObjOraError.Show MODAL
  145.  End
  146.  
  147. NoODBCConnection:
  148.  End
  149.  
  150. End Sub
  151.  
  152. Sub Form_Load ()
  153.  
  154.  Call CenterForm(frmObjLogin)
  155.  
  156. End Sub
  157.  
  158. Sub txtDatabaseName_GotFocus ()
  159.  
  160.  txtDatabaseName.SelStart = 0
  161.  txtDatabaseName.SelLength = Len(txtDatabaseName.Text)
  162.  
  163. End Sub
  164.  
  165. Sub txtODBCDatabaseName_GotFocus ()
  166.  
  167.  txtODBCDatabaseName.SelStart = 0
  168.  txtODBCDatabaseName.SelLength = Len(txtODBCDatabaseName.Text)
  169.  
  170. End Sub
  171.  
  172. Sub txtPassword_GotFocus ()
  173.  
  174.  txtPassword.SelStart = 0
  175.  txtPassword.SelLength = Len(txtPassword.Text)
  176.  
  177. End Sub
  178.  
  179. Sub txtUsername_GotFocus ()
  180.  
  181.  txtUserName.SelStart = 0
  182.  txtUserName.SelLength = Len(txtUserName.Text)
  183.  
  184. End Sub
  185.  
  186.