home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Unleashed / Visual_Basic_4_Unleashed_SAMS_Publishing_1995.iso / sfi / vbxctdem / gbass.bas < prev    next >
Encoding:
BASIC Source File  |  1994-12-08  |  2.2 KB  |  79 lines

  1. Global compdate As String
  2. Global usid As String
  3. Global pword As String
  4. Global sid As String
  5. Global datbase As String
  6.  
  7. Global dbconn As Integer
  8. Global ret As Long
  9. Global updflag As Integer
  10.  
  11. Global ctx_pointer As Long
  12. Global con_pointer As Long
  13. Global cmd_pointer As Long
  14.  
  15. Sub extendederrordata (c_pointer As Long)
  16.     Dim ncols As Long
  17.     Dim rows_read As Long
  18.  
  19.     ret = VBCT_res_info(c_pointer, CS_NUMDATA, ncols)
  20.     ret = VBCT_do_binds(c_pointer)
  21.     While ret = CS_SUCCEED Or ret = CS_ROW_FAIL
  22.         ret = VBCT_fetch(c_pointer, 0, 0, 0, rows_read)
  23.         edata$ = ""
  24.         If ret = CS_SUCCEED Then
  25.             For i = 1 To ncols
  26.                 t$ = VBCT_data(c_pointer, i)
  27.                 edata$ = edata$ & t$ & "  "
  28.             Next
  29.             MsgBox "Extended error data is " & edata$
  30.         End If
  31.     Wend
  32. End Sub
  33.  
  34. Function process_no_rows (c As String) As Integer
  35.     Dim restype As Long
  36.     Dim ncols As Long
  37.     Dim rinfo As Long
  38.     Dim cmd_ptr As Long
  39.  
  40.     ret = VBCT_cmd_alloc(con_pointer, cmd_ptr)
  41.     process_result = 99
  42.  
  43. '   Set up the command buffer for processing
  44.  
  45.         ret = VBCT_command_str(cmd_ptr, CS_LANG_CMD, c, CS_UNUSED)
  46.         
  47. '   Send the command(s) to the server for processing
  48.  
  49.         ret = VBCT_send(cmd_ptr)
  50.         
  51. '   Process the result sets comming back from the server
  52.  
  53.         result_ret = VBCT_results(cmd_ptr, restype)
  54.         res$ = ""
  55.         While result_ret = CS_SUCCEED
  56.         
  57.             Select Case restype
  58.             
  59.             Case CS_CMD_DONE, CS_CMD_SUCCEED, CS_CMD_FAIL
  60.                 Select Case restype
  61.                 Case CS_CMD_DONE
  62.                     rt$ = "CS_CMD_DONE"
  63.                 Case CS_CMD_SUCCEED
  64.                     rt$ = "CS_CMD_SUCCEED"
  65.                 Case CS_CMD_FAIL
  66.                     rt$ = "CS_CMD_FAIL"
  67.                     process_result = 0
  68.                 End Select
  69. '                MsgBox "Command status " & rt$ & " recieved"
  70.             Case Else
  71.                 MsgBox "This command should never reach here"
  72.             End Select
  73.         result_ret = VBCT_results(cmd_ptr, restype)
  74.     Wend
  75.  
  76.     process_no_rows = process_result
  77. End Function
  78.  
  79.