home *** CD-ROM | disk | FTP | other *** search
/ Datatid 1999 #6 / Datatid_1999-06.iso / internet / Tango352Promo / P.SQL / PTKPKG.1 / SQLAPI32.BAS < prev    next >
Encoding:
BASIC Source File  |  1998-12-09  |  17.2 KB  |  347 lines

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