home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / errors / errors.bas next >
BASIC Source File  |  1993-12-13  |  39KB  |  598 lines

  1. ' Copyright ⌐ 1993 by John Murdoch. All Rights Reserved.
  2. ' This module may be incorporated into your code, but may
  3. ' not be resold or redistributed without my prior written
  4. ' permission. Subscribers to Data Based Advisor Magazine
  5. ' and/or members of the CompuServe DBADVISOR forum may
  6. ' distribute this function within their organizations without
  7. ' prior permission.
  8.  
  9. Type ErrorType
  10.     ErrNum As Integer
  11.     Headline As String
  12.     ProblemMsg As String
  13.     ResponseMsg As String
  14.     MoreInfoVisible As Integer
  15.     Button1Caption As String
  16.     Button2Caption As String
  17.     Label01 As String
  18.     Label02 As String
  19.     Label03 As String
  20.     Label04 As String
  21.     Label05 As String
  22.     Label06 As String
  23.     Label07 As String
  24.     Label08 As String
  25.     Label09 As String
  26.     Label10 As String
  27.     Data01 As Variant
  28.     Data02 As Variant
  29.     Data03 As Variant
  30.     Data04 As Variant
  31.     Data05 As Variant
  32.     Data06 As Variant
  33.     Data07 As Variant
  34.     Data08 As Variant
  35.     Data09 As Variant
  36.     Data10 As Variant
  37.     Bitmap As Integer
  38. End Type
  39.  
  40. Function ErrorHandler (ErrorStruct As ErrorType) As Integer
  41. ' Maintenance Header
  42. ' Version   Date        Coder       Action
  43. '   1       9/21/93     Murdoch     Initial keyin
  44.  
  45. ' Calls:
  46. '   FillErrorStruct
  47.  
  48. ' Is Called By:
  49.  
  50. ' Purpose:
  51. '   Passed a structure, this reads the information,
  52. ' and displays it on the Errors form.
  53.  
  54. If Len(ErrorStruct.Headline) < 1 Then
  55.     Answer% = FillErrorStruct(ErrorStruct)
  56. End If
  57.  
  58. ' Assign the right picture from the storage array....
  59. If ErrorStruct.Bitmap > 3 Then
  60.     Errors!imgPicture.Picture = Errors!imgStorage(0).Picture
  61. Else
  62.     Errors!imgPicture.Picture = Errors!imgStorage(ErrorStruct.Bitmap).Picture
  63. End If
  64.  
  65. Errors!lblHeadline.Caption = ErrorStruct.Headline
  66. Errors!lblProblem.Caption = ErrorStruct.ProblemMsg
  67. Errors!lblResponse.Caption = ErrorStruct.ResponseMsg
  68. Errors!cmdAction(2).Visible = ErrorStruct.MoreInfoVisible
  69.  
  70. If Not IsNull(ErrorStruct.Label01) Then
  71.     Errors!lblLabel(0).Caption = ErrorStruct.Label01
  72.     Errors!lblData(0).Caption = ErrorStruct.Data01
  73. Else
  74.     Errors!lblLabel(0).Visible = False
  75.     Errors!lblData(0).Visible = False
  76. End If
  77.  
  78. If Not IsNull(ErrorStruct.Label02) Then
  79.     Errors!lblLabel(1).Caption = ErrorStruct.Label02
  80.     Errors!lblData(1).Caption = ErrorStruct.Data02
  81. Else
  82.     Errors!lblLabel(1).Visible = False
  83.     Errors!lblData(1).Visible = False
  84. End If
  85.  
  86. If Not IsNull(ErrorStruct.Label03) Then
  87.     Errors!lblLabel(2).Caption = ErrorStruct.Label03
  88.     Errors!lblData(2).Caption = ErrorStruct.Data03
  89. Else
  90.     Errors!lblLabel(2).Visible = False
  91.     Errors!lblData(2).Visible = False
  92. End If
  93.  
  94. If Not IsNull(ErrorStruct.Label04) Then
  95.     Errors!lblLabel(3).Caption = ErrorStruct.Label04
  96.     Errors!lblData(3).Caption = ErrorStruct.Data04
  97. Else
  98.     Errors!lblLabel(3).Visible = False
  99.     Errors!lblData(3).Visible = False
  100. End If
  101.  
  102. If Not IsNull(ErrorStruct.Label05) Then
  103.     Errors!lblLabel(4).Caption = ErrorStruct.Label05
  104.     Errors!lblData(4).Caption = ErrorStruct.Data05
  105. Else
  106.     Errors!lblLabel(4).Visible = False
  107.     Errors!lblData(4).Visible = False
  108. End If
  109.  
  110. If Not IsNull(ErrorStruct.Label06) Then
  111.     Errors!lblLabel(5).Caption = ErrorStruct.Label06
  112.     Errors!lblData(5).Caption = ErrorStruct.Data06
  113. Else
  114.     Errors!lblLabel(5).Visible = False
  115.     Errors!lblData(5).Visible = False
  116. End If
  117.  
  118. If Not IsNull(ErrorStruct.Label07) Then
  119.     Errors!lblLabel(6).Caption = ErrorStruct.Label07
  120.     Errors!lblData(6).Caption = ErrorStruct.Data07
  121. Else
  122.     Errors!lblLabel(6).Visible = False
  123.     Errors!lblData(6).Visible = False
  124. End If
  125.  
  126. If Not IsNull(ErrorStruct.Label08) Then
  127.     Errors!lblLabel(7).Caption = ErrorStruct.Label08
  128.     Errors!lblData(7).Caption = ErrorStruct.Data08
  129. Else
  130.     Errors!lblLabel(7).Visible = False
  131.     Errors!lblData(7).Visible = False
  132. End If
  133.  
  134. If Not IsNull(ErrorStruct.Label09) Then
  135.     Errors!lblLabel(8).Caption = ErrorStruct.Label09
  136.     Errors!lblData(8).Caption = ErrorStruct.Data09
  137. Else
  138.     Errors!lblLabel(8).Visible = False
  139.     Errors!lblData(8).Visible = False
  140. End If
  141.  
  142. If Not IsNull(ErrorStruct.Label10) Then
  143.     Errors!lblLabel(9).Caption = ErrorStruct.Label10
  144.     Errors!lblData(9).Caption = ErrorStruct.Data10
  145. Else
  146.     Errors!lblLabel(9).Visible = False
  147.     Errors!lblData(9).Visible = False
  148. End If
  149.  
  150. LeftPos% = (Screen.Width - Errors.Width) \ 2
  151. TopPos% = (Screen.Height - Errors.Height) \ 2
  152. Errors.Move LeftPos%, TopPos%
  153. Errors.Show MODAL
  154.  
  155. End Function
  156.  
  157. Function FillErrorStruct (ErrorStruct As ErrorType)
  158. ' Copyright ⌐ 1993 by John Murdoch. All Rights Reserved.
  159. ' This function may be incorporated into your code, but may
  160. ' not be resold or redistributed without my prior written
  161. ' permission. Subscribers to Data Based Advisor Magazine
  162. ' and/or members of the CompuServe DBADVISOR forum may
  163. ' distribute this function within their organizations without
  164. ' prior permission.
  165.  
  166. ' Maintenance Header
  167. ' Version   Date        Coder       Action
  168. '   1       9/21/93     Murdoch     Initial keyin
  169. '   1a      10/23/93    Murdoch     More typing...
  170. '   1b      10/25/93    Murdoch     Still typing...
  171. '   1c      10/28/93    Murdoch     Done! (I got blisters on ma
  172. '                                   fingers....)
  173.  
  174. ' Is Called By:
  175. '   Utility routine. Called by local error handlers.
  176.  
  177. ' Purpose:
  178. '   If the headline passed is null, we're asking for
  179. ' the library to fill in the Headline, Problem, and
  180. ' Response fields with stock material.
  181.     
  182. Select Case ErrorStruct.ErrNum
  183.     Case 607        ' Access attempted on unopened database
  184.         ErrorStruct.Headline = "Error: Database Not Open"
  185.         ErrorStruct.ProblemMsg = "The application could not open a database file. This can happen if the application or database has not been installed properly, or if a configuration option is not set correctly."
  186.         ErrorStruct.ResponseMsg = "If the application has just been installed, make sure that the installation was done properly. If you have been using the application for some time, check the network connection, file access permissions for the current user, and if the database file still exists."
  187.     
  188.     Case 616        ' Table exists, no append allowed
  189.         ErrorStruct.Headline = "Error: Cannot Append to Table "
  190.         ErrorStruct.ProblemMsg = "The application could not append data to the database table. "
  191.         ErrorStruct.ResponseMsg = "Contact tech support and tell them that you encountered error number 616. "
  192.     
  193.     Case 617        ' No fields defined - cannot append table
  194.         ErrorStruct.Headline = "Error: Cannot Append to Table "
  195.         ErrorStruct.ProblemMsg = "The application attempted to append records to a table in the database. It was unable to do so. "
  196.         ErrorStruct.ResponseMsg = "Contact tech support, and tell them you encountered error number 617.  "
  197.     
  198.     Case 622        ' CommitTrans/Rollback illegal - Transactions not supported
  199.         ErrorStruct.Headline = "Error: Transaction Processing Not Supported "
  200.         ErrorStruct.ProblemMsg = "Most databases support " & Chr$(34) & "transaction processing," & Chr$(34) & "but the database you are connected to does not."
  201.         ErrorStruct.ResponseMsg = "Contact tech support. You may need an updated piece of software, or you may be connected to the wrong file.  "
  202.  
  203.     Case 623        ' Name not found in this collection
  204.         ErrorStruct.Headline = "Error: Name Not Found in Collection "
  205.         ErrorStruct.ProblemMsg = "The application has referred to an object that is not part of the data collection (where the application thinks it should be). "
  206.         ErrorStruct.ResponseMsg = "Contact tech support. You may need an updated piece of software, or you may be connected to the wrong file."
  207.  
  208.     Case 625        ' Data type of field "item" not supported by target database
  209.         ErrorStruct.Headline = "Error: Unsupported Data Type"
  210.         ErrorStruct.ProblemMsg = "The database does not support the data type that the application tried to store."
  211.         ErrorStruct.ResponseMsg = "Contact tech support. You may need a new piece of software, a new database file, or you may be connected to the wrong file."
  212.  
  213.     Case 626        ' Attempt to move past EOF
  214.         ErrorStruct.Headline = "Error: Can't Move Past EOF"
  215.         ErrorStruct.ProblemMsg = "The application referred to a record that is past the end of the file."
  216.         ErrorStruct.ResponseMsg = "Contact tech support RIGHT NOW. This error message can be an indication of a damaged database file--a serious problem. Write down what record you were working on, and what anybody else using the system was doing. Do not continue working with the application."
  217.  
  218.     Case 627        ' Dynaset is not updateable or Edit method has not been invoked
  219.         ErrorStruct.Headline = "Error: Dynaset Is Not Updateable"
  220.         ErrorStruct.ProblemMsg = "A program error has happened--the application tried to update a record in a database that could not be edited."
  221.         ErrorStruct.ResponseMsg = "Contact tech support. Tell them you have encountered error number 627."
  222.  
  223.     Case 630        ' Property is read only
  224.         ErrorStruct.Headline = "Error: Read Only Property"
  225.         ErrorStruct.ProblemMsg = "The application tried to change the value of a program property that is set to read-only."
  226.         ErrorStruct.ResponseMsg = "Contact tech support. Tell them you have encountered error number 630."
  227.  
  228.     Case 632        ' Update illegal without previous Edit or AddNew
  229.         ErrorStruct.Headline = "Error: Update Without Edit or AddNew"
  230.         ErrorStruct.ProblemMsg = "The application has tried to update a record--but has not yet created the record or opened it for editing."
  231.         ErrorStruct.ResponseMsg = "Contact tech support. Tell them you have encountered error number 632."
  232.  
  233.     Case 633        ' Append illegal - Field is part of a TableDefs collection
  234.         ErrorStruct.Headline = "Error: Tried to Append to TableDefs Collection"
  235.         ErrorStruct.ProblemMsg = "The application tried to append (add) a record to a table structure--rather than the table itself."
  236.         ErrorStruct.ResponseMsg = "Contact tech support. Tell them you have encountered error number 633."
  237.  
  238.     Case 634        ' Property value only valid when Field is part of a dynaset
  239.         ErrorStruct.Headline = "Error: Incorrect Use of Field Property"
  240.         ErrorStruct.ProblemMsg = "The application has attempted to use a database value incorrectly."
  241.         ErrorStruct.ResponseMsg = "Contact tech support, and tell them you have encountered error number 634. You may need new program files or an updated database."
  242.  
  243.     Case 635        ' Cannot set the property of an object which is part of a database object
  244.         ErrorStruct.Headline = "Error: Cannot Set Object Property "
  245.         ErrorStruct.ProblemMsg = "The application attempted to set a database property--but the database table is currently in use."
  246.         ErrorStruct.ResponseMsg = "Contact tech support. Tell them you have encountered error number 635. You may need updated program files."
  247.  
  248.     Case 638        ' Access attempted on an unopened dynaset
  249.         ErrorStruct.Headline = "Error: Data Not Opened Yet"
  250.         ErrorStruct.ProblemMsg = "The application attempted to read data from a table (actually a dynaset) that has not been opened."
  251.         ErrorStruct.ResponseMsg = "Contact tech support. Tell them you have encountered error number 638. You may been updated program files."
  252.  
  253.     Case 639        ' Field size illegal for specified field type
  254.         ErrorStruct.Headline = "Error: Incorrect Field Size"
  255.         ErrorStruct.ProblemMsg = "The application has attempted to write data to the database--and the field size in the database won't support the size of the variable being written."
  256.         ErrorStruct.ResponseMsg = "Check the data value--you may have accidentally entered a number that is too big. If you continue to get an error message, contact tech support and tell them you have encountered error number 639."
  257.  
  258.     Case 643        ' Property not found
  259.         ErrorStruct.Headline = "Error: Property Not Found"
  260.         ErrorStruct.ProblemMsg = "The application has tried to read or change a program property--but the property is not there."
  261.         ErrorStruct.ResponseMsg = "Contact tech support--you may need updated program files. Tell them you encountered error number 643."
  262.  
  263.     Case 646        ' GetChunk: Offset/size argument combination illegal
  264.         ErrorStruct.Headline = "Error: GetChunk Failed "
  265.         ErrorStruct.ProblemMsg = "The application tried to read a portion of a file--but the size of the portion, or where it began, (or both) was incorrect."
  266.         ErrorStruct.ResponseMsg = "Contact tech support RIGHT NOW. This is usually an indication of a problem with a file. Tell them that you have encountered error number 646."
  267.  
  268.     Case 648        ' Data access objects require VBDB300.DLL
  269.         ErrorStruct.Headline = "Error: VBDB300.DLL Not Found"
  270.         ErrorStruct.ProblemMsg = "The application requires a file named VBDB300.DLL. The file could not be located on your system."
  271.         ErrorStruct.ResponseMsg = "Check to be sure that VBDB300.DLL is installed in your file PATH, your \WINDOWS\SYSTEM directory, or in the same directory as the application EXE file."
  272.  
  273.     Case 2420 To 2422   ' Syntax error in number, date, or string
  274.         ErrorStruct.Headline = "Error: Syntax Error"
  275.         ErrorStruct.ProblemMsg = "The application has referred to a number, date, or string incorrectly."
  276.         ErrorStruct.ResponseMsg = "Contact tech support. Tell them you have encountered error number " & Format$(ErrorStruct.ErrNum) & "."
  277.  
  278.     Case 2431 To 2434   ' syntax error
  279.         ErrorStruct.Headline = "Error: Syntax Error"
  280.         ErrorStruct.ProblemMsg = "The application contains an error in the program code that has halted the program."
  281.         ErrorStruct.ResponseMsg = "Contact tech support. Tell them you have encountered error number " & Format$(ErrorStruct.ErrNum) & "."
  282.  
  283.     Case 3005       ' "Item" isn't a valid database name
  284.         ErrorStruct.Headline = "Error: Invalid Database Name "
  285.         ErrorStruct.ProblemMsg = "The application has attempted to access a database--but cannot find a database with that name."
  286.         ErrorStruct.ResponseMsg = "Contact tech support--you will probably need updated program files."
  287.  
  288.     Case 3006       ' Database is exclusively locked
  289.         ErrorStruct.Headline = "Problem: The Database Is Exclusively Locked"
  290.         ErrorStruct.ProblemMsg = "The application cannot open the database--it is presently locked by another user or application."
  291.         ErrorStruct.ResponseMsg = "Someone may be editing the database file directly, or there may be a problem in the program code. Check to see if anyone else is using the database (whether with an application or with a database editor). If no one is, contact tech support."
  292.  
  293.     Case 3007       ' Couldn't open database
  294.         ErrorStruct.Headline = "Error: Could Not Open Database"
  295.         ErrorStruct.ProblemMsg = "The application was unable to open a database file."
  296.         ErrorStruct.ResponseMsg = "Check to see if someone else is using the database. If no one is, contact tech support and tell them you have encountered error number 3007."
  297.  
  298.     Case 3008, 3189 ' Table is exclusively locked
  299.         ErrorStruct.Headline = "Error: Table Exclusively Locked "
  300.         ErrorStruct.ProblemMsg = "The application has been prevented from opening a database table. Someone else is using it. "
  301.         ErrorStruct.ResponseMsg = "Wait a moment or two and try again. Chances are that the table is only locked momentarily."
  302.  
  303.     Case 3009       ' Table in use--could not lock
  304.         ErrorStruct.Headline = "Error: Table Could Not Be Locked"
  305.         ErrorStruct.ProblemMsg = "The application tried to lock a table in the database, and could not."
  306.         ErrorStruct.ResponseMsg = "Someone else is presently using the same table. Wait a moment and try again. If you still get this message, contact tech support."
  307.  
  308.     Case 3011       ' Couldn't find object "item"
  309.         ErrorStruct.Headline = "Error: Cannot Find Object"
  310.         ErrorStruct.ProblemMsg = "The application has tried to find a particular database object, and cannot."
  311.         ErrorStruct.ResponseMsg = "Contact tech support. Tell them you have encountered error number 3011. You may need an updated database file."
  312.  
  313.     ' A mere 56 to go....
  314.     Case 3014       ' Couldn't open any more tables
  315.         ErrorStruct.Headline = "Error: Couldn't Open Any More Tables "
  316.         ErrorStruct.ProblemMsg = "The application has attempted to open a database table, but cannot."
  317.         ErrorStruct.ResponseMsg = "Contact tech support. You may have to adjust entries in your CONFIG.SYS file (not likely) or there is a program flaw. Tell them you encountered error number 3014."
  318.  
  319.     Case 3015       ' "Item" isn't an index in this table
  320.         ErrorStruct.Headline = "Error: Use of Invalid Index"
  321.         ErrorStruct.ProblemMsg = "The application tried to use a database index that doesn't exist."
  322.         ErrorStruct.ResponseMsg = "Contact tech support--this is most likely a case of having a program file that is more current that the database file you're using. Tell them you have encountered error number 3015."
  323.  
  324.     Case 3016       ' Field won't fit in this record
  325.         ErrorStruct.Headline = "Error: Field Won't Fit in Record"
  326.         ErrorStruct.ProblemMsg = "The application has tried to copy the contents of a database record, and the record won't fit."
  327.         ErrorStruct.ResponseMsg = "Contact tech support. Tell them you have encountered error number 3016. You may need new programs files or an updated database."
  328.  
  329.     Case 3017       ' Field length is too long
  330.         ErrorStruct.Headline = "Error: Field Length Too Long "
  331.         ErrorStruct.ProblemMsg = "The application has tried to define a text field that is longer than 255 characters."
  332.         ErrorStruct.ResponseMsg = "Contact tech support. Tell them you have encountered error number 3017."
  333.  
  334.     Case 3018       ' Couldn't find field "item"
  335.         ErrorStruct.Headline = "Error: Cannot Find Field "
  336.         ErrorStruct.ProblemMsg = "The application has tried to access a field--but cannot find it."
  337.         ErrorStruct.ResponseMsg = "Contact tech support. Tell them you have encountered error number 3018."
  338.  
  339.     Case 3019       ' Operation invalid without a current index
  340.         ErrorStruct.Headline = "Error: Must Have a Current Index "
  341.         ErrorStruct.ProblemMsg = "The application requires a current index."
  342.         ErrorStruct.ResponseMsg = "Contact tech support. Tell them you have encountered error number 3019."
  343.  
  344.     Case 3020       ' Update without Add or Edit
  345.         ErrorStruct.Headline = "Error: Update Without Add or Edit"
  346.         ErrorStruct.ProblemMsg = "The application has encountered an error updating a database table."
  347.         ErrorStruct.ResponseMsg = "Contact tech support. You will probably need to get updated program files."
  348.  
  349.     Case 3021       ' No current record
  350.         ErrorStruct.Headline = "Error: No Current Record"
  351.         ErrorStruct.ProblemMsg = "The application is looking for a record, and has encountered difficulty."
  352.         ErrorStruct.ResponseMsg = "Contact tech support. Tell them you have encountered error number 3021."
  353.     
  354.     Case 3022       ' Duplicate key
  355.         ErrorStruct.Headline = "Error: Duplicate Key"
  356.         ErrorStruct.ProblemMsg = "The application has attempted to write data to a field--but an identical record exists."
  357.         ErrorStruct.ResponseMsg = "Are you entering a duplicate record? Check your work to be sure that you're not trying to add records that already exist. If necessary, contact tech support and tell them you have encountered error number 3022."
  358.         
  359.     Case 3023       ' Add or Edit already used
  360.         ErrorStruct.Headline = "Error: Add or Edit Already Used "
  361.         ErrorStruct.ProblemMsg = "The application has attempted to open a database record--but the record is already open."
  362.         ErrorStruct.ResponseMsg = "Contact tech support. Do NOT continue entering records. "
  363.  
  364.     Case 3024       ' Couldn't find field "item"
  365.         ErrorStruct.Headline = "Error: Could Not Find a Field "
  366.         ErrorStruct.ProblemMsg = "The application is looking for a field in the database that is not there. "
  367.         ErrorStruct.ResponseMsg = "Contact tech support. Tell them you have encountered error 3024. Do not continue entering data. "
  368.  
  369.     Case 3025       ' Can't open any more files
  370.         ErrorStruct.Headline = "Error: Cannot Open Files "
  371.         ErrorStruct.ProblemMsg = "The application cannot open any more files--as a result, it has stopped. "
  372.         ErrorStruct.ResponseMsg = "Contact tech support and tell them you have encountered error 3025. You will probably need to increase the " & Chr$(34) & "FILES=" & Chr$(34) & " statement in your CONFIG.SYS file, but check with tech support first. "
  373.  
  374.     Case 3026       ' Not enough space on disk
  375.         ErrorStruct.Headline = "Error: Not Enough Space Free on Disk "
  376.         ErrorStruct.ProblemMsg = "The application cannot write data to the disk drive, because it is full.  "
  377.         ErrorStruct.ResponseMsg = "Use File Manager to remove unused files from your disk drive. If you do not know which files are safe to remove, check with your LAN administrator or contact tech support."
  378.  
  379.     Case 3027       ' Couldn't update, database is read only
  380.         ErrorStruct.Headline = "Error: Cannot Update Read Only Database"
  381.         ErrorStruct.ProblemMsg = "The application is trying to write data to a read-only database."
  382.         ErrorStruct.ResponseMsg = "Contact tech support. Tell them you have encountered error number 3027."
  383.  
  384.     Case 3028       ' Couldn't initialize data access, because System.MDA couldn't be opened
  385.         ErrorStruct.Headline = "Error: Cannot Open SYSTEM.MDA"
  386.         ErrorStruct.ProblemMsg = "Your application requires the presence of a file named SYSTEM.MDA. The application cannot open it, probably because it cannot find it."
  387.         ErrorStruct.ResponseMsg = "Check to be sure that any network connections are still valid, and that the SYSTEM.MDA file is visible on your system. If the problem reoccurs, contact tech support and tell them you have error number 3028."
  388.  
  389.     Case 3029       ' Not a valid account name or password
  390.         ErrorStruct.Headline = "Error: Not a Valid Account Name or Password"
  391.         ErrorStruct.ProblemMsg = "Your application has attempted to attach to the network, but the account name or password was not accepted."
  392.         ErrorStruct.ResponseMsg = "Contact your LAN administrator to be sure that you are using the correct name and password. Then try again. "
  393.  
  394.     Case 3030       ' "Item" isn't a valid account name
  395.         ErrorStruct.Headline = "Error: Invalid Account Name "
  396.         ErrorStruct.ProblemMsg = "Your application has attempted to attach to the network, but the account name given is not valid. "
  397.         ErrorStruct.ResponseMsg = "Contact your LAN administrator to get the correct name to use."
  398.  
  399.     Case 3031       ' Not a valid password
  400.         ErrorStruct.Headline = "Error: Invalid Password"
  401.         ErrorStruct.ProblemMsg = "Your application has attempted to attach to the network, but the password given is not valid. "
  402.         ErrorStruct.ResponseMsg = "Try re-entering the password. If it still doesn't work, contact your LAN administrator."
  403.  
  404.     Case 3032       ' Can't delete account
  405.         ErrorStruct.Headline = "Error: Can't Delete Account"
  406.         ErrorStruct.ProblemMsg = "Your application has attempted to delete a network account. It cannot do so. "
  407.         ErrorStruct.ResponseMsg = "In all likelihood the account could not be deleted because somebody is presently using it. Contact your LAN administrator. "
  408.  
  409.     Case 3033       ' No permission for "item"
  410.         ErrorStruct.Headline = "Error: Permission Error "
  411.         ErrorStruct.ProblemMsg = "Your application tried to read or write data from a directory or file to which you do not have appropriate rights. "
  412.         ErrorStruct.ResponseMsg = "Contact your LAN administrator for permission to use the file, or contact tech support. "
  413.  
  414.     Case 3034       ' Commit or Rollback without BeginTrans
  415.         ErrorStruct.Headline = "Error: Transaction Ended--But Not Begun "
  416.         ErrorStruct.ProblemMsg = "Your application attempted to save a database entry--but never began one. "
  417.         ErrorStruct.ResponseMsg = "Contact tech support--do NOT continue data entry. "
  418.  
  419.     Case 3036       ' Database has reached maximum size
  420.         ErrorStruct.Headline = "Error: Database Has Reached Maximum Size "
  421.         ErrorStruct.ProblemMsg = "One of your database files has reached the maximum possible size for that type of file. You cannot add any more information to the file. "
  422.         ErrorStruct.ResponseMsg = "Depending on the database format, you may be able to compact the file to gain more space. You should, however, contact tech support. "
  423.  
  424.     Case 3037       ' Can't open any more tables or queries
  425.         ErrorStruct.Headline = "Error: Can't Open Any More Tables or Queries "
  426.         ErrorStruct.ProblemMsg = "Your application has tried to open more tables or queries than is permitted. "
  427.         ErrorStruct.ResponseMsg = "Contact tech support, and tell them you have encountered error number 3037. Do NOT continue data entry. "
  428.  
  429.     Case 3040       ' Disk I/O error during read
  430.         ErrorStruct.Headline = "Error: Disk I/O Error "
  431.         ErrorStruct.ProblemMsg = "An error was encountered while attempting to access your hard disk drive. "
  432.         ErrorStruct.ResponseMsg = "Contact tech support immediately. Do NOT continue data entry. Tell them you have encountered error number 3040. "
  433.  
  434.     Case 3041       ' Incompatible database version
  435.         ErrorStruct.Headline = "Error: Incompatible Database Version "
  436.         ErrorStruct.ProblemMsg = "Your application cannot open a database file--the file is the wrong version. "
  437.         ErrorStruct.ResponseMsg = "Check your startup information--the application may be opening the wrong file. Check to be sure that your data files are correctly installed. If this error persists, contact tech support. "
  438.  
  439.     Case 3042       ' Out of MS-DOS file handles
  440.         ErrorStruct.Headline = "Error: Out of DOS File Handles "
  441.         ErrorStruct.ProblemMsg = "Your computer system needs to have a change made to your CONFIG.SYS file. "
  442.         ErrorStruct.ResponseMsg = "Change the " & Chr$(34) & "FILES=" & Chr$(34) & " line in your CONFIG.SYS file to 40 or more. If you have never edited CONFIG.SYS, contact your LAN administrator or call tech support. "
  443.  
  444.     Case 3043       ' Disk or network error
  445.         ErrorStruct.Headline = "Error: Disk or Network Error "
  446.         ErrorStruct.ProblemMsg = "Your application has attempted to access files on your hard drive, or on the network, and could not. "
  447.         ErrorStruct.ResponseMsg = "If you are using a Local Area Network, attempt to re-connect to the LAN. Contact your LAN Adminstrator for help and more instructions. "
  448.  
  449.     Case 3045       ' File already in use
  450.         ErrorStruct.Headline = "Error: File in Use "
  451.         ErrorStruct.ProblemMsg = "Your application cannot open a file--another user or application is using it. "
  452.         ErrorStruct.ResponseMsg = "Contact tech support and tell them you have encountered error number 3045.  "
  453.  
  454.     Case 3046, 3158, 3186, 3202, 3218, 3260 ' Couldn't save--record locked by another user
  455.         ErrorStruct.Headline = "Error: Record Locked "
  456.         ErrorStruct.ProblemMsg = "Your application is trying to read or write information--but another user has that part of the database locked. "
  457.         ErrorStruct.ResponseMsg = "Try continuing--the problem may not happen again. If this error continues, contact tech support and tell them you have encountered error number " & Format$(ErrorStruct.ErrNum) & "."
  458.     
  459.     Case 3051       ' Couldn't open file "item"
  460.         ErrorStruct.Headline = "Error: Could Not Open File "
  461.         ErrorStruct.ProblemMsg = "Your application tried to open a file, and could not. "
  462.         ErrorStruct.ResponseMsg = "Contact tech support--tell them you have encountered error number 3051. Do NOT continue data entry. "
  463.     
  464.     Case 3052       ' MS-DOS file sharing lock count exceeded (increase SHARE.EXE locks)
  465.         ErrorStruct.Headline = "Error: DOS File Sharing Locks "
  466.         ErrorStruct.ProblemMsg = "Your computer system doesn't have the SHARE lock count set high enough. "
  467.         ErrorStruct.ResponseMsg = "Change the SHARE line in your AUTOEXEC.BAT file. It should be set to 500 locks or higher. "
  468.     
  469.     Case 3054       ' Too many Memo or Long Binary fields
  470.         ErrorStruct.Headline = "Error: Too Many Memo or Long Binary Fields "
  471.         ErrorStruct.ProblemMsg = "Your database file format does not support all the fields defined by your application. "
  472.         ErrorStruct.ResponseMsg = "Contact tech support. Tell them you have encountered error number 3054. They will need to revise the application or change your database file format. "
  473.  
  474.     Case 3056       ' Couldn't repair this database
  475.         ErrorStruct.Headline = "Error: Cannot Repair Database "
  476.         ErrorStruct.ProblemMsg = "The application attempted to repair the database, and could not. "
  477.         ErrorStruct.ResponseMsg = "Contact tech support--stop ALL data entry immediately! "
  478.  
  479.     Case 3058       ' Can't have null value in index
  480.         ErrorStruct.Headline = "Error: Null Value in Index "
  481.         ErrorStruct.ProblemMsg = "The application has tried to save a value that has not been entered. "
  482.         ErrorStruct.ResponseMsg = "Check to be sure that you have all the fields filled in. Contact tech support, and tell them you have encountered error number 3058. "
  483.  
  484.     Case 3059       ' Operation cancelled by user
  485.         ErrorStruct.Headline = "Error: Operation Cancelled "
  486.         ErrorStruct.ProblemMsg = "You cancelled an operation that was in progress. "
  487.         ErrorStruct.ResponseMsg = "Cancelling the action may have undesireable results. Contact tech support, and tell them what happened. Do not continue data entry until you have talked with them. "
  488.  
  489.     Case 3071       ' Can't evaluate expression
  490.         ErrorStruct.Headline = "Error: Can't Evaluate Expression "
  491.         ErrorStruct.ProblemMsg = "The application could not correctly express the search you described. "
  492.         ErrorStruct.ResponseMsg = "Try the search again. If you still need help, check the program documentation, and contact tech support. "
  493.  
  494.     Case 3160       ' Table isn't open
  495.         ErrorStruct.Headline = "Error: Table Not Open "
  496.         ErrorStruct.ProblemMsg = "The application has tried to access a data table that has not been opened. "
  497.         ErrorStruct.ResponseMsg = "Contact tech support--tell them you have encountered error number 3160. "
  498.         
  499.     Case 3161       ' Couldn't decrypt file
  500.         ErrorStruct.Headline = "Error: Cannot Decrypt File "
  501.         ErrorStruct.ProblemMsg = "Your application stores data in encrypted form--the application could not decrypt the data it needs. "
  502.         ErrorStruct.ResponseMsg = "Check to be sure that you have the correct version of the database file installed. If you do, contact tech support immediately."
  503.  
  504.     Case 3167       ' Record is deleted
  505.         ErrorStruct.Headline = "Error: Record Deleted "
  506.         ErrorStruct.ProblemMsg = "Your application attempted to access a database record, but the record has already been deleted. "
  507.         ErrorStruct.ResponseMsg = "If possible, use another means to determine that the record is not there. If it is (so this message is mistaken) contact tech support. "
  508.  
  509.     Case 3183       ' Not enough space on temporary disk
  510.         ErrorStruct.Headline = "Error: Not Enough Space on Temporary Disk "
  511.         ErrorStruct.ProblemMsg = "The program needs to use your temporary disk--but there is not enough space free. "
  512.         ErrorStruct.ResponseMsg = "Check to see if you have other programs using the temporary disk (such as print caching software). Remove those programs, or check with tech support. "
  513.  
  514.     Case 3187       ' Couldn't read, record is currently locked by another user
  515.         ErrorStruct.Headline = "Error: Record Locked "
  516.         ErrorStruct.ProblemMsg = "The record you need (or one nearby in the database) is currently locked. "
  517.         ErrorStruct.ResponseMsg = "Try repeating the action once or twice. If the problem persists, contact tech support. "
  518.  
  519.     Case 3188       ' Couldn't update--record is locked by another session on *this* machine
  520.         ErrorStruct.Headline = "Error: Record Locked "
  521.         ErrorStruct.ProblemMsg = "The record you need (or one nearby in the database) is currently locked. "
  522.         ErrorStruct.ResponseMsg = "Try repeating the action once or twice. If the problem persists, contact tech support. "
  523.  
  524.     Case 3197       ' Data has changed--operation stopped
  525.         ErrorStruct.Headline = "Data Has Changed "
  526.         ErrorStruct.ProblemMsg = "The data record you are trying to change has been changed since you read it. "
  527.         ErrorStruct.ResponseMsg = "Contact tech support--do not continue, or you will overwrite data that has been saved by another user. "
  528.  
  529.     Case 3198       ' Couldn't start session, too many sessions already active
  530.         ErrorStruct.Headline = "Error: Not Enough Sessions "
  531.         ErrorStruct.ProblemMsg = "The program uses a database that limits the number of sessions available. All sessions are in use. "
  532.         ErrorStruct.ResponseMsg = "Check with your LAN administrator or tech support. All check with your co-workers--somebody may have a record open that could be closed. "
  533.  
  534.     Case 3200       ' Can't delete or change record--referential integrity violation
  535.         ErrorStruct.Headline = " "
  536.         ErrorStruct.ProblemMsg = " "
  537.         ErrorStruct.ResponseMsg = " "
  538.  
  539.     Case 3201       ' Can't add or change--referential integrity violation
  540.         ErrorStruct.Headline = "Error: Referential Integrity Violation "
  541.         ErrorStruct.ProblemMsg = "Your application has tried to add data to a detail table--but hasn't added a record header first. "
  542.         ErrorStruct.ResponseMsg = "Do NOT continue. Contact tech support. "
  543.  
  544.     Case 3211, 3212 ' Couldn't lock table--currently in use
  545.         ErrorStruct.Headline = "Error: Could Not Lock Table "
  546.         ErrorStruct.ProblemMsg = "Your application needs to lock a table in the database--but someone else is using it. "
  547.         ErrorStruct.ResponseMsg = "Wait a second or two, and try again. If the problem persists, check with your co-workers to see if somebody has a record from the table in use--but might close it. "
  548.  
  549.     Case 3224       ' Btrieve data dictionary is corrupted
  550.         ErrorStruct.Headline = "Error: Btrieve Data Dictionary Problem "
  551.         ErrorStruct.ProblemMsg = "Your database has a damaged data dictionary.  "
  552.         ErrorStruct.ResponseMsg = "Stop what you are doing. Write down what you are presently doing, and what the other people in your workgroup are doing. Call tech support immediately. "
  553.  
  554.     Case 3225       ' Record locking deadlock in Btrieve
  555.         ErrorStruct.Headline = "Error: Deadlock in Btrieve Database "
  556.         ErrorStruct.ProblemMsg = "You have a record open that another user needs--and that user has a record open that you need.  "
  557.         ErrorStruct.ResponseMsg = "Both of you are pretty well stuck. Write down what you're doing, and contact tech support. "
  558.         
  559.     Case 3226, 3240 ' Btrieve DLL error
  560.         ErrorStruct.Headline = "Error: Btrieve DLL Error "
  561.         ErrorStruct.ProblemMsg = "The application couldn't find the right Btrieve database DLL file.  "
  562.         ErrorStruct.ResponseMsg = "Chances are you have recently installed another application that has installed a new DLL file. Check with tech support to see if you need an updated program file. "
  563.  
  564.     Case 3229 To 3238   ' ODBC Error
  565.         ErrorStruct.Headline = "Error: ODBC Error "
  566.         ErrorStruct.ProblemMsg = "Your application has encountered an error working with an ODBC database. "
  567.         ErrorStruct.ResponseMsg = "Check your network connections, particularly connections to your database server. If they're OK, check with your LAN administrator or with tech support. "
  568.  
  569.     Case 3239       ' Too many active users
  570.         ErrorStruct.Headline = "Error: Too Many Active Users "
  571.         ErrorStruct.ProblemMsg = "Your application (probably the database) limits the number of users who can be logged on at a time. You're over the limit. "
  572.         ErrorStruct.ResponseMsg = "Check with your LAN adminstrator--and with your co-workers. There may be somebody who's still logged in that doesn't need to be. "
  573.     
  574.     Case 3270       ' Property not found
  575.         ErrorStruct.Headline = "Error: Property Not Found "
  576.         ErrorStruct.ProblemMsg = "Your application tried to access a database feature that your database doesn't support. "
  577.         ErrorStruct.ResponseMsg = "Contact tech support. Tell them what you were doing in the program, and ask for an updated program file. "
  578.  
  579.     Case 3271       ' Invalid property value
  580.         ErrorStruct.Headline = "Error: Invalid Property Value "
  581.         ErrorStruct.ProblemMsg = "Your application tried to change a value (probably in the database) that isn't the right type for the change that was attempted. "
  582.         ErrorStruct.ResponseMsg = "Contact tech support. Tell them what you were doing in the program, and ask for an updated program file. "
  583.  
  584.     Case Else       ' A truly unique problem...
  585.         ErrorStruct.Headline = "Error " & Format$(ErrorStruct.ErrNum) & ": Contact Tech Support"
  586.         ErrorStruct.ProblemMsg = Error
  587.         ErrorStruct.ResponseMsg = "Contact tech support and tell them you have encountered Error Number " & Str$(ErrorStruct.ErrNum) & ". You should write down what you were doing when the error occured--the program function you were using, the record you were working with, and what you were doing. You should also write down what other users were doing at the same time."
  588. End Select
  589.  
  590.  
  591.  
  592. End Function
  593.  
  594. Sub Main ()
  595. Errors.Show
  596. End Sub
  597.  
  598.