home *** CD-ROM | disk | FTP | other *** search
/ Datatid 1999 #6 / Datatid_1999-06.iso / internet / Tango352Promo / P.SQL / PTKPKG.1 / SQLAPI16.BAS < prev    next >
Encoding:
BASIC Source File  |  1998-11-27  |  15.9 KB  |  342 lines

  1. '*************************************************************************
  2. '**
  3. '**  Copyright 1997 Pervasive Software Inc. All Rights Reserved
  4. '**
  5. '*************************************************************************
  6. '*************************************************************************
  7. '   SQLAPI16.BAS
  8. '   This module is for use with 16-Bit Visual Basic for MS-Windows and
  9. '   Scalable SQL.  It contains declarations for Scalable SQL APIs.
  10. '
  11. '*************************************************************************
  12. '*************************************************************************
  13. '   SESSION MANAGEMENT PRIMITIVES
  14. '   The following primitives are required by applications which
  15. '   want to use multiple SQL logins:
  16. '         xGetSessionID
  17. '         xPutSessionID
  18. '*************************************************************************
  19.   Declare Function xGetSessionID Lib "w1sqlv7.dll" ( ByRef iSessionID% ) As Integer
  20.   Declare Function xPutSessionID Lib "w1sqlv7.dll" ( ByVal iSessionID% ) As Integer
  21.  
  22. '*************************************************************************
  23. '   MISCELLANEOUS FUNCTIONS
  24. '      xShareSessionID
  25. '      SQLGetCountDatabaseNames
  26. '      SQLGetCountRemoteDatabaseNames
  27. '      SQLGetDatabaseNames
  28. '      SQLGetRemoteDatabaseNames
  29. '      SQLUnloadDBNames
  30. '*************************************************************************
  31.   Declare Function xShareSessionID Lib "w1sqlv7.dll" ( _
  32.                       ByRef tChangeCount% ) As Integer
  33.  
  34.   Declare Function SQLGetCountDatabaseNames Lib "wdbnames.dll" ( _
  35.                       ByRef tCount% ) As Integer
  36.  
  37.   Declare Function SQLGetCountRemoteDatabaseNames Lib "wdbnames.dll" ( _
  38.                       ByRef tCount% ) As Integer
  39.  
  40.   Declare Function SQLGetDatabaseNames Lib "wdbnames.dll" ( _
  41.                       ByRef tBufLen%, _
  42.                       ByRef bDataBuf As Any ) As Integer
  43.  
  44.   Declare Function SQLGetRemoteDatabaseNames Lib "wdbnames.dll" ( _
  45.                       ByRef tBufLen%, _
  46.                       ByRef bDataBuf As Any ) As Integer
  47.  
  48.   Declare Function SQLUnloadDBNames Lib "wdbnames.dll" _
  49.                       ( ByVal iReserved% ) As Integer
  50.  
  51.  
  52. '*************************************************************************
  53. '   SQL-LEVEL FUNCTIONS
  54. '   This includes 4 former Primitive-Level Functions.
  55. '      XQLCursor           XQLSPUtility        xFetch
  56. '      XQLCompile          XQLStatus           xInsert
  57. '      XQLDescribe         XQLStop             xRemove
  58. '      XQLExec             XQLSubst            xUpdate
  59. '      XQLFetch            XQLVersion
  60. '      XQLFormat           XQLConvert
  61. '      XQLFree             XQLValidate
  62. '      XQLLogin            XQLMask
  63. '      XQLLogout
  64. '*************************************************************************
  65.   Declare Function XQLCompile Lib "w1sqlv7.dll" ( _
  66.                       ByVal iCursorID%, ByRef tStatementLen%, _
  67.                       ByRef sStatement As Any ) As Integer
  68.  
  69.   Declare Function XQLConvert Lib "w1sqlv7.dll" ( _
  70.                       ByVal iOption%, ByVal iType%, ByVal tSize%, _
  71.                       ByVal tDec%, ByVal tDSize%, ByRef sValue As Any, _
  72.                       ByRef sRetValue As Any, ByRef sMask As Any, _
  73.                       ByVal iJustify% ) As Integer
  74.  
  75.   Declare Function XQLCursor Lib "w1sqlv7.dll" ( _
  76.                       ByRef iCursorID% ) As Integer
  77.  
  78.   Declare Function XQLDescribe Lib "w1sqlv7.dll" ( _
  79.                       ByVal iCursorID%, ByVal iPosition%, ByRef iDataType%, _
  80.                       ByRef tSize%, ByRef tDecPlaces%, ByRef tDisplayLen%, _
  81.                       ByRef tNameLen%, ByRef sName As Any ) As Integer
  82.  
  83.   Declare Function XQLExec Lib "w1sqlv7.dll" ( _
  84.                       ByVal iCursorID% ) As Integer
  85.  
  86.   Declare Function XQLFetch Lib "w1sqlv7.dll" ( _
  87.                       ByVal iCursorID%, ByVal iOption%, _
  88.                       ByRef tBufLen%, ByRef bDataBuf As Any, ByRef lCount&, _
  89.                       ByVal iASCIIFlag%, ByVal iSpacing% ) As Integer
  90.  
  91.   Declare Function XQLFormat Lib "w1sqlv7.dll" ( _
  92.                       ByVal iCursorID%, ByVal tPosition%, ByVal tMaskLen%, _
  93.                       ByRef sMask As Any ) As Integer
  94.  
  95.   Declare Function XQLFree Lib "w1sqlv7.dll" ( _
  96.                       ByVal iCursorID% ) As Integer
  97.  
  98.   Declare Function XQLLogin Lib "w1sqlv7.dll" ( _
  99.                       ByRef sUser     As Any, ByRef sPassword  As Any, _
  100.                       ByRef sDDPath   As Any, ByRef sDataPath  As Any, _
  101.                       ByRef sReserved As Any, ByVal iFeaturesUsed% ) As Integer
  102.  
  103.   Declare Function XQLLogout Lib "w1sqlv7.dll" () As Integer
  104.  
  105.   Declare Function XQLMask Lib "w1sqlv7.dll" ( _
  106.                       ByVal iOption%, ByVal iType%, ByVal tSize%, _
  107.                       ByVal tDec%, ByRef tLen%, ByRef sMask As Any ) As Integer
  108.  
  109.   Declare Function XQLSPUtility Lib "w1sqlv7.dll" ( _
  110.                       ByVal iCursorID%, ByVal iOption%, _
  111.                       ByRef tStatementCount%, ByRef tStatementExec%, _
  112.                       ByRef tBufLen%, ByRef bDataBuf As Any ) As Integer
  113.  
  114.   Declare Function XQLStatus Lib "w1sqlv7.dll" ( _
  115.                       ByVal iCursorID%, ByVal iOption%, _
  116.                       ByRef sStatBuf As Any ) As Integer
  117.  
  118.   Declare Function XQLStop Lib "w1sqlv7.dll" () As Integer
  119.  
  120.   Declare Function XQLSubst Lib "w1sqlv7.dll" ( _
  121.                       ByVal iCursorID%, ByVal tCount%, _
  122.                       ByVal tNameLen%, ByRef sVarNames As Any, _
  123.                       ByVal tTextLen%, ByRef sValueText As Any ) As Integer
  124.  
  125.   Declare Function XQLValidate Lib "w1sqlv7.dll" ( _
  126.                       ByRef tCount%, ByRef sFieldName As Any, ByVal tBufLen%, _
  127.                       ByRef bDataBuf As Any ) As Integer
  128.  
  129.   Declare Function XQLVersion Lib "w1sqlv7.dll" ( _
  130.                       ByRef sVersion As Any ) As Integer
  131.  
  132.   Declare Function xFetch Lib "w1sqlv7.dll" ( _
  133.                       ByVal iCursorID%, ByRef tBufLen%, ByVal iOption%, _
  134.                       ByRef lRecordCount&, ByRef lRejectCount&, _
  135.                       ByRef bDataBuf As Any ) As Integer
  136.  
  137.   Declare Function xInsert Lib "w1sqlv7.dll" ( _
  138.                       ByVal iCursorID%, ByRef tFileCount%, _
  139.                       ByRef sFileName As Any, ByRef lRecordCount&, _
  140.                       ByRef bDataBuf As Any ) As Integer
  141.  
  142.   Declare Function xRemove Lib "w1sqlv7.dll" ( _
  143.                       ByVal iCursorID%, ByRef tFileCount%, _
  144.                       ByRef sFileName As Any, ByRef lRecordCount& ) As Integer
  145.  
  146.   Declare Function xUpdate Lib "w1sqlv7.dll" ( _
  147.                       ByVal iCursorID%, ByRef tFileCount%, _
  148.                       ByRef sFileName As Any, ByRef lRecordCount&, _
  149.                       ByRef bDataBuf As Any ) As Integer
  150.  
  151. '***********************************************************************
  152. '   HISTORICAL RELATIONAL PRIMITIVES
  153. '      The following functions will be phased out over time.  They
  154. '      are included in the interface modules to support existing
  155. '      applications.  New applications should not use these functions.
  156. '
  157. '      xCompute    xOrder         xDD            xAccess
  158. '      xDescribe   xRemall        xDDAttr        xPassword
  159. '      xMovefld    xReset         xDDModify      xSecurity
  160. '      xField      xRestrict      xDDCreate      xUser
  161. '      xFree       xStore         xDDDrop        xChar
  162. '      xJoin       xStop          xDDField       xVersion
  163. '      xLogin      xTrans         xDDFile        xStatus
  164. '      xLogout     xRecall        xDDIndex       xConvert
  165. '      xNew        xUpdall        xDDPath        xValidate
  166. '                                 xDDView        xMask
  167. '***********************************************************************
  168. '------------------------------------------------
  169. '   Dictionary Primitives
  170. '------------------------------------------------
  171.   Declare Function xDD Lib "w1sqlv7.dll" ( _
  172.                       ByRef sPathName As Any, ByVal iOption% ) As Integer
  173.  
  174.   Declare Function xDDAttr Lib "w1sqlv7.dll" ( _
  175.                       ByVal iOption%, ByRef sFldName As Any, _
  176.                       ByVal iAttrType%, ByRef tBufLen%, _
  177.                       ByRef sAttrBuf As Any ) As Integer
  178.  
  179.   Declare Function xDDCreate Lib "w1sqlv7.dll" ( _
  180.                       ByVal iOption%, ByRef sFileName As Any, _
  181.                       ByVal iCreate%, ByRef sPathName As Any, _
  182.                       ByRef sOwner As Any, ByVal iOwnerFlag%, _
  183.                       ByVal tFldCount%, ByRef bFldBuf As Any, _
  184.                       ByVal tIndxCount%, ByRef bIndx As Any, _
  185.                       ByVal tLen%, ByRef bCPrms As Any ) As Integer
  186.  
  187.   Declare Function xDDDrop Lib "w1sqlv7.dll" ( _
  188.                       ByRef sName As Any, ByVal iType%, ByVal iDelete% ) As Integer
  189.  
  190.   Declare Function xDDField Lib "w1sqlv7.dll" ( _
  191.                       ByVal iOption%, ByRef iCount%, _
  192.                       ByRef sFldNames As Any, ByRef iBufLen%, _
  193.                       ByRef bDataBuf As Any ) As Integer
  194.  
  195.   Declare Function xDDFile Lib "w1sqlv7.dll" ( _
  196.                       ByVal iOption%, ByRef tCount%, _
  197.                       ByRef sFileName As Any, ByRef tBufLen%, _
  198.                       bDataBuf As Any ) As Integer
  199.  
  200.   Declare Function xDDIndex Lib "w1sqlv7.dll" ( _
  201.                       ByVal iOption%, ByRef tCount%, _
  202.                       ByRef sIndexName As Any, ByRef tBufLen%, _
  203.                       ByRef bDataBuf As Any ) As Integer
  204.  
  205.   Declare Function xDDModify Lib "w1sqlv7.dll" ( _
  206.                       ByVal iOption%, ByRef sFileName As Any, _
  207.                       ByVal iCreate%, ByRef sPathName As Any, _
  208.                       ByRef sOwner As Any, ByVal iOwnerFlag%, _
  209.                       ByVal tFldCount%, ByRef bFldBuf As Any, _
  210.                       ByVal tIndxCount%, ByRef bIndxBuf As Any ) As Integer
  211.  
  212.   Declare Function xDDPath Lib "w1sqlv7.dll" ( _
  213.                       ByVal iOption%, ByRef sPathName As Any ) As Integer
  214.  
  215.   Declare Function xDDView Lib "w1sqlv7.dll" ( _
  216.                       ByRef tCount%, ByRef sViewName As Any, _
  217.                       ByRef tBufLen%, ByRef bDataBuf As Any ) As Integer
  218.  
  219. ' -------------------------------------------------------
  220. ' Data Manipulation Primitives
  221. ' -------------------------------------------------------
  222.   Declare Function xCompute Lib "w1sqlv7.dll" ( _
  223.                       ByVal iCursorID%, ByRef sFldName As Any, _
  224.                       ByVal iFldType%, ByVal tFldLen%, ByVal tDecPlaces%, _
  225.                       ByRef tExpLen%, ByRef sExpression As Any ) As Integer
  226.  
  227.   Declare Function xConvert Lib "w1sqlv7.dll" ( _
  228.                       ByVal iOption%, ByVal iType%, ByVal tSize%, ByVal tDec%, _
  229.                       ByVal tDSize%, ByRef sValue As Any, _
  230.                       ByRef sRetVal As Any, ByRef sMask As Any, _
  231.                       ByVal iJustify% ) As Integer
  232.  
  233.   Declare Function xDescribe Lib "w1sqlv7.dll" ( _
  234.                       ByVal iCursorID%, ByVal iOption%, ByRef tBufLen%, _
  235.                       ByVal tPosition%, ByRef tCount%, bDataBuf As Any ) As Integer
  236.  
  237.   Declare Function xField Lib "w1sqlv7.dll" ( _
  238.                       ByVal iCursorID%, ByVal iOption%, ByVal tPosition%, _
  239.                       ByRef tCount%, ByRef sFldNames As Any ) As Integer
  240.  
  241.   Declare Function xFree Lib "w1sqlv7.dll" ( _
  242.                       ByVal iCursorID% ) As Integer
  243.  
  244.   Declare Function xJoin Lib "w1sqlv7.dll" ( _
  245.                       ByVal iCursorID%, ByRef sSecFile As Any, _
  246.                       ByRef sOwner As Any, ByVal iOption%, ByVal tPriFldCount%, _
  247.                       ByRef sPriFlds As Any, ByVal tSecFldCount%, _
  248.                       ByRef sSecFlds As Any ) As Integer
  249.  
  250.   Declare Function xMask Lib "w1sqlv7.dll" ( _
  251.                       ByVal iOption%, ByVal iType%, ByVal tSize%, ByVal iDec%, _
  252.                       ByRef tLen%, ByRef sMask As Any ) As Integer
  253.  
  254.   Declare Function xMoveFld Lib "w1sqlv7.dll" ( _
  255.                       ByVal iCursorID%, ByVal tFromPosition%, _
  256.                       ByVal tToPosition% ) As Integer
  257.  
  258.   Declare Function xNew Lib "w1sqlv7.dll" ( _
  259.                       ByRef iCursorID%, ByRef sFileName As Any, _
  260.                       ByRef sOwner As Any, ByVal iOpenMode% ) As Integer
  261.  
  262.   Declare Function xOrder Lib "w1sqlv7.dll" ( _
  263.                       ByVal iCursorID%, ByVal tCount%, _
  264.                       ByRef bOrderFld As Any ) As Integer
  265.  
  266.   Declare Function xRecall Lib "w1sqlv7.dll" ( _
  267.                       iCursorID%, ByRef sViewName As Any, ByVal iOwnerCount%, _
  268.                       ByRef sOwner As Any, ByVal iOpenMode%, ByRef iTextLen%, _
  269.                       ByRef sText As Any ) As Integer
  270.  
  271.   Declare Function xRemall Lib "w1sqlv7.dll" ( _
  272.                       ByVal iCursorID%, ByRef tFileCount%, _
  273.                       ByRef sFileName As Any, ByVal iOption%, _
  274.                       ByRef lRecordCount As Long, ByRef lRejectCount As Long ) As Integer
  275.  
  276.   Declare Function xReset Lib "w1sqlv7.dll" ( _
  277.                       ByRef sReserved As Any ) As Integer
  278.  
  279.   Declare Function xRestrict Lib "w1sqlv7.dll" ( _
  280.                       ByVal iCursorID%, ByVal iOption%, _
  281.                       ByRef tExpLen%, ByRef sExpression As Any ) As Integer
  282.  
  283.   Declare Function xStatus Lib "w1sqlv7.dll" ( _
  284.                       ByVal iCursorID%, ByVal iOption%, ByRef tLen%, _
  285.                       ByRef sStatBuf As Any ) As Integer
  286.  
  287.   Declare Function xStore Lib "w1sqlv7.dll" ( _
  288.                       ByVal iCursorID%, ByRef sViewName As Any, _
  289.                       ByVal iTextLen%, ByRef sText As Any ) As Integer
  290.  
  291.   Declare Function xTrans Lib "w1sqlv7.dll" ( _
  292.                       ByVal iOption% ) As Integer
  293.  
  294.   Declare Function xUpdall Lib "w1sqlv7.dll" ( _
  295.                       ByVal iCursorID%, ByRef tFileCount%, _
  296.                       ByRef sFileName As Any, ByVal iOption%, _
  297.                       ByRef lRecordCount As Long, ByRef lRejectCount As Long, _
  298.                       ByVal tFldCount%, ByRef sUpdateFld As Any, _
  299.                       ByRef sReplaceFld As Any ) As Integer
  300.  
  301.   Declare Function xValidate Lib "w1sqlv7.dll" ( _
  302.                       ByRef tCount%, ByRef sFieldName As Any, _
  303.                       ByVal tBufLen%, ByRef bDataBuf As Any ) As Integer
  304.  
  305. '--------------------------------------------------
  306. '    Data Control Primitives
  307. '--------------------------------------------------
  308.   Declare Function xAccess Lib "w1sqlv7.dll" ( _
  309.                       ByRef sMstrPswd As Any, ByRef sUser As Any, _
  310.                       ByVal iOption%, ByVal iAccRights%, _
  311.                       ByRef sFileName As Any, ByRef tCount%, _
  312.                       ByRef sFldNames As Any, ByRef tBufLen%, _
  313.                       bDataBuf As Any ) As Integer
  314.  
  315.   Declare Function xChar Lib "w1sqlv7.dll" ( _
  316.                       ByVal iOption%, ByVal iType%, _
  317.                       ByRef cCharacter As Any ) As Integer
  318.  
  319.   Declare Function xLogin Lib "w1sqlv7.dll" ( _
  320.                       ByRef sUser As Any, ByRef sPassword As Any, _
  321.                       ByRef sDDPath As Any, ByRef sDataPath As Any, _
  322.                       ByRef sReserved As Any, ByVal iFeaturesUsed% ) As Integer
  323.  
  324.   Declare Function xLogout Lib "w1sqlv7.dll" ( ) As Integer
  325.  
  326.   Declare Function xPassword Lib "w1sqlv7.dll" ( _
  327.                       ByRef sUser As Any, ByRef sPassword As Any ) As Integer
  328.  
  329.   Declare Function xSecurity Lib "w1sqlv7.dll" ( _
  330.                       ByRef sMstrPswd As Any, ByVal iOption%) As Integer
  331.  
  332.   Declare Function xStop Lib "w1sqlv7.dll" ( ) As Integer
  333.  
  334.   Declare Function xUser Lib "w1sqlv7.dll" ( _
  335.                       ByRef sMstrPswd As Any, ByVal iOption%, _
  336.                       ByRef sUser As Any, ByRef sPassword As Any, _
  337.                       ByVal iFlags%, ByRef tCount%, ByRef tBufLen%, _
  338.                       bDataBuf As Any ) As Integer
  339.  
  340.   Declare Function xVersion Lib "w1sqlv7.dll" ( _
  341.                      ByRef sVersion As Any ) As Integer
  342.