home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / btrtest / btrtest.bas < prev    next >
BASIC Source File  |  1992-03-16  |  7KB  |  130 lines

  1.  
  2. Sub StartUp ()
  3.     
  4.     ' Initialize Btrieve
  5.     InitDB
  6.        
  7. End Sub
  8.  
  9. Sub BtrErr (Status%)
  10.  
  11.     ' Process Btrieve Error Messages
  12.     Select Case Status%
  13.     Case 1: Msg$ = "Invalid Operation, Error # " + Str$(Status%)
  14.     Case 2: Msg$ = "File I/O Error # " + Str$(Status%)
  15.     Case 3: Msg$ = "File Not Open, Error #" + Str$(Status%)
  16.     Case 4: Msg$ = "Key Value Not Found, Error # " + Str$(Status%)
  17.     Case 5: Msg$ = "Duplicate Key Value, Error #" + Str$(Status%)
  18.     Case 6: Msg$ = "Invalid Key Number, Error # " + Str$(Status%)
  19.     Case 7: Msg$ = "Different Key Number, Error # " + Str$(Status%)
  20.     Case 8: Msg$ = "Invalid Postioning, Error # " + Str$(Status%)
  21.     Case 9: Msg$ = "End Of File, Error # " + Str$(Status%)
  22.     Case 10: Msg$ = "Non-Modifiable Key Error # " + Str$(Status%)
  23.     Case 11: Msg$ = "Invalid File Name, Error # " + Str$(Status%)
  24.     Case 12: Msg$ = "File Not Found, Error # " + Str$(Status%)
  25.     Case 13: Msg$ = "Extended File Error # " + Str$(Status%)
  26.     Case 14: Msg$ = "Pre-Image Open Error # " + Str$(Status%)
  27.     Case 15: Msg$ = "Pre-Image I/O Error # " + Str$(Status%)
  28.     Case 16: Msg$ = "Expansion Error # " + Str$(Status%)
  29.     Case 17: Msg$ = "Close Error # " + Str$(Status%)
  30.     Case 18: Msg$ = "Disk Full, Error # " + Str$(Status%)
  31.     Case 19: Msg$ = "Unrecoverable Error # " + Str$(Status%)
  32.     Case 20: Msg$ = "Record Manager Inactive, Error # " + Str$(Status%)
  33.     Case 21: Msg$ = "Key Buffer Too Short, Error # " + Str$(Status%)
  34.     Case 22: Msg$ = "Data Buffer Length Error # " + Str$(Status%)
  35.     Case 23: Msg$ = "Postion Block Length Error # " + Str$(Status%)
  36.     Case 24: Msg$ = "Page Size Error # " + Str$(Status%)
  37.     Case 25: Msg$ = "I/O Creation Error # " + Str$(Status%)
  38.     Case 26: Msg$ = "Number of Keys Error # " + Str$(Status%)
  39.     Case 27: Msg$ = "Invalid Key Length, Error # " + Str$(Status%)
  40.     Case 28: Msg$ = "Invalid Record Length, Error # " + Str$(Status%)
  41.     Case 29: Msg$ = "Invalid Key Length, Error # " + Str$(Status%)
  42.     Case 30: Msg$ = "Not A Btrieve File, Error # " + Str$(Status%)
  43.     Case 31: Msg$ = "File Already Extended, Error # " + Str$(Status%)
  44.     Case 32: Msg$ = "Extend I/O Error # " + Str$(Status%)
  45.     Case 33: Msg$ = "Not Defined, Error # " + Str$(Status%)
  46.     Case 34: Msg$ = "Invalid Extension Partition Error # " + Str$(Status%)
  47.     Case 35: Msg$ = "Directory Error # " + Str$(Status%)
  48.     Case 36: Msg$ = "Transaction Error # " + Str$(Status%)
  49.     Case 37: Msg$ = "Transaction Is Active Error # " + Str$(Status%)
  50.     Case 38: Msg$ = "Transaction Control File Error # " + Str$(Status%)
  51.     Case 39: Msg$ = "End/Abort Transaction Error # " + Str$(Status%)
  52.     Case 40: Msg$ = "Transaction Maximum Files Error # " + Str$(Status%)
  53.     Case 41: Msg$ = "Operation Not Allowed, Error # " + Str$(Status%)
  54.     Case 42: Msg$ = "Incomplete Accelerated Access, Error # " + Str$(Status%)
  55.     Case 43: Msg$ = "Invalid Record Address, Error # " + Str$(Status%)
  56.     Case 44: Msg$ = "Null Key Path, Error # " + Str$(Status%)
  57.     Case 45: Msg$ = "Inconsistent Key Path, Error # " + Str$(Status%)
  58.     Case 46: Msg$ = "File Access Denied, Error # " + Str$(Status%)
  59.     Case 47: Msg$ = "Exceeded Open Files Maximum, Error # " + Str$(Status%)
  60.     Case 48: Msg$ = "Invalid Alternative Sequence Definition, Error # " + Str$(Status%)
  61.     Case 49: Msg$ = "Invalid Key Type, Error # " + Str$(Status%)
  62.     Case 50: Msg$ = "Owner Already Set, Error # " + Str$(Status%)
  63.     Case 51: Msg$ = "Invalid Owner, Error # " + Str$(Status%)
  64.     Case 52: Msg$ = "Writing Cache, Error # " + Str$(Status%)
  65.     Case 53: Msg$ = "Invalid Interface, Error # " + Str$(Status%)
  66.     Case 54: Msg$ = "Variable Length Record Damage, Error # " + Str$(Status%)
  67.     Case 55: Msg$ = "Auto-increment Key Error # " + Str$(Status%)
  68.     Case 56: Msg$ = "Suplimental Index Damage, Error # " + Str$(Status%)
  69.     Case 57: Msg$ = "Expanded Memory Error # " + Str$(Status%)
  70.     Case 58: Msg$ = "Compression Buffer To Short, Error # " + Str$(Status%)
  71.     Case 59: Msg$ = "File Already Exists, Error # " + Str$(Status%)
  72.     Case 60: Msg$ = "Reject Count Reached, Error # " + Str$(Status%)
  73.     Case 61: Msg$ = "Work Space Too Small, Error # " + Str$(Status%)
  74.     Case 62: Msg$ = "Incorrect Data Buffer Structure, Error # " + Str$(Status%)
  75.     Case 63: Msg$ = "Invalid Extented Insert Buffer, Error # " + Str$(Status%)
  76.     Case 64: Msg$ = "Filter Limit Reached, Error # " + Str$(Status%)
  77.     Case 65: Msg$ = "Incorrect Field Offset, Error # " + Str$(Status%)
  78.     Case 66: Msg$ = "Not Defined, Error # " + Str$(Status%)
  79.     Case 67: Msg$ = "Not Define, Error # " + Str$(Status%)
  80.     Case 68: Msg$ = "Not Defined, Error # " + Str$(Status%)
  81.     Case 69: Msg$ = "Not Defined, Error # " + Str$(Status%)
  82.     Case 70: Msg$ = "Not Defined, Error # " + Str$(Status%)
  83.     Case 71: Msg$ = "Not Defined, Error # " + Str$(Status%)
  84.     Case 72: Msg$ = "Not Defined, Error # " + Str$(Status%)
  85.     Case 73: Msg$ = "Not Defined, Error # " + Str$(Status%)
  86.     Case 74: Msg$ = "Automatic Transaction Abort, Error # " + Str$(Status%)
  87.     Case 75: Msg$ = "Not Defined, Error # " + Str$(Status%)
  88.     Case 76: Msg$ = "Not Defined, Error # " + Str$(Status%)
  89.     Case 77: Msg$ = "Not Defined, Error # " + Str$(Status%)
  90.     Case 78: Msg$ = "Deadlock Detected, Error # " + Str$(Status%)
  91.     Case 79: Msg$ = "Not Defined, Error # " + Str$(Status%)
  92.     Case 80: Msg$ = "Record Change Conflict, Error # " + Str$(Status%)
  93.     Case 81: Msg$ = "Lock Error # " + Str$(Status%)
  94.     Case 82: Msg$ = "Lost Position, Error # " + Str$(Status%)
  95.     Case 83: Msg$ = "Read Outside Transaction, Error # " + Str$(Status%)
  96.     Case 84: Msg$ = "Record Locked, Error # " + Str$(Status%)
  97.     Case 85: Msg$ = "File Locked, Error # " + Str$(Status%)
  98.     Case 86: Msg$ = "File Table Full, Error # " + Str$(Status%)
  99.     Case 87: Msg$ = "Handle Table Full, Error # " + Str$(Status%)
  100.     Case 88: Msg$ = "Incompatible Mode, Error # " + Str$(Status%)
  101.     Case 89: Msg$ = "Error 89 Not Defined, Error # " + Str$(Status%)
  102.     Case 90: Msg$ = "Redirected Device Table Full, Error # " + Str$(Status%)
  103.     Case 91: Msg$ = "Server Error # " + Str$(Status%)
  104.     Case 92: Msg$ = "Transaction table Full, Error # " + Str$(Status%)
  105.     Case 93: Msg$ = "Incompatibel Lock Type, Error # " + Str$(Status%)
  106.     Case 94: Msg$ = "Invalid Priviledges, Error # " + Str$(Status%)
  107.     Case 95: Msg$ = "Session No Longer Valid, Error # " + Str$(Status%)
  108.     Case 96: Msg$ = "Communication Environment Error # " + Str$(Status%)
  109.     Case 97: Msg$ = "Data Message Too Small, Error # " + Str$(Status%)
  110.     Case 98: Msg$ = "Internal Transaction Error # " + Str$(Status%)
  111.     Case 1010: Msg$ = "Unable To Read Btrieve During Recovery, Error # " + Str$(Status%)
  112.     Case Else: Msg$ = "Not Defined, Error # " + Str$(Status%)
  113.     End Select
  114.     Beep: Beep
  115.     Response% = MsgBox(Msg$, 0, "Data Base Error")
  116.  
  117. End Sub
  118.  
  119. Sub InitDB ()
  120.  
  121.     INIT = "/P:4096 /M:48 /F:20 /U:2"
  122.     x = WBTRVINIT(INIT)
  123.     If x <> 0 Then
  124.     Response% = MsgBox("Could Not Initialize Data Base", 0, "Error Message")
  125.     End
  126.     End If
  127.  
  128. End Sub
  129.  
  130.