home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 February / PCWK0296.iso / po7_win / object10 / vbsoerr.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-11-20  |  2.7 KB  |  94 lines

  1. VERSION 2.00
  2. Begin Form frmOraError 
  3.    BorderStyle     =   3  'Fixed Double
  4.    Caption         =   "VB*SQL Error"
  5.    ClientHeight    =   1440
  6.    ClientLeft      =   1740
  7.    ClientTop       =   5895
  8.    ClientWidth     =   6675
  9.    Height          =   1845
  10.    Left            =   1680
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    ScaleHeight     =   1440
  14.    ScaleWidth      =   6675
  15.    Top             =   5550
  16.    Width           =   6795
  17.    Begin TextBox txtError 
  18.       Height          =   1215
  19.       Left            =   720
  20.       MultiLine       =   -1  'True
  21.       ScrollBars      =   2  'Vertical
  22.       TabIndex        =   2
  23.       Top             =   120
  24.       Width           =   4575
  25.    End
  26.    Begin CommandButton Help 
  27.       Caption         =   "Help"
  28.       Height          =   495
  29.       Left            =   5400
  30.       TabIndex        =   1
  31.       Top             =   720
  32.       Width           =   1215
  33.    End
  34.    Begin CommandButton OK 
  35.       Caption         =   "OK"
  36.       Default         =   -1  'True
  37.       Height          =   495
  38.       Left            =   5400
  39.       TabIndex        =   0
  40.       Top             =   120
  41.       Width           =   1215
  42.    End
  43.    Begin Image Image1 
  44.       Height          =   480
  45.       Left            =   120
  46.       Picture         =   VBSOERR.FRX:0000
  47.       Top             =   360
  48.       Width           =   480
  49.    End
  50. Option Explicit
  51. Sub Cancel_Click ()
  52.  OraSession.LastServerErrReset
  53.  Unload frmOraError
  54. End Sub
  55. Sub Form_Load ()
  56.  Call CenterForm(frmOraError)
  57.  txtError = ""
  58.  'If I get an error on login, the database object won't
  59.  'be created yet.
  60.  On Error GoTo nodb
  61.  If OraDatabase.LastServerErr <> 0 Then
  62.   App.HelpFile = "ORA.HLP"
  63.   txtError = txtError & OraDatabase.LastServerErrText
  64.   frmOraError.HelpContextID = OraDatabase.LastServerErr
  65.  End If
  66.  If OraSession.LastServerErr <> 0 Then
  67.   App.HelpFile = "ORA.HLP"
  68.   txtError = txtError & OraSession.LastServerErrText
  69.   frmOraError.HelpContextID = OraSession.LastServerErr
  70.  End If
  71.  If OraSession.LastServerErr = 0 And OraDatabase.LastServerErr = 0 Then
  72.   txtError = "VB:" & Trim$(Str$(Err)) & " - " & Error$
  73.  End If
  74.  Exit Sub
  75. nodb:
  76.  If OraSession.LastServerErr <> 0 Then
  77.   App.HelpFile = "ORA.HLP"
  78.   txtError = txtError & OraSession.LastServerErrText
  79.   frmOraError.HelpContextID = OraSession.LastServerErr
  80.  Else
  81.   txtError = "VB:" & Trim$(Str$(Err)) & " - " & Error$
  82.  End If
  83.  Exit Sub
  84. End Sub
  85. Sub Help_Click ()
  86.  'Send an F1 to the app which will cause the help file
  87.  'listed in the project options to be opened.
  88.  SendKeys "{F1}"
  89. End Sub
  90. Sub OK_Click ()
  91.  App.HelpFile = ""
  92.  Unload frmOraError
  93. End Sub
  94.