' ########################################################################################
' Microsoft Windows
' File: msdasql.inc
' Contents: Provider Specific definitions
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_msdasql_PBI)
#DEFINE PBX_msdasql_PBI
%EQUATE `MSDASQL_INC = 1
#INCLUDE ONCE "Legacy/COM/oledb.inc"
'// Provider Class Id
'#ifdef DBINITCONSTANTS
$IID_ISQLRequestDiagFields = GUID$("{228972F0-B5FF-11D0-8A80-00C04FD611CD}")
$IID_ISQLGetDiagField = GUID$("{228972F1-B5FF-11D0-8A80-00C04FD611CD}")
$IID_IRowsetChangeExtInfo = GUID$("{0C733A8F-2A1C-11CE-ADE5-00aa0044773d}")
$CLSID_MSDASQL = GUID$("{C8B522CB-5CF3-11CE-ADE5-00AA0044773D}")
$CLSID_MSDASQL_ENUMERATOR = GUID$("{C8B522CD-5CF3-11CE-ADE5-00AA0044773D}")
'#endif // DBINITCONSTANTS
'//----------------------------------------------------------------------------
'// MSDASQL specific properties
'#ifdef DBINITCONSTANTS
$DBPROPSET_PROVIDERDATASOURCEINFO = GUID$("{497C60E0-7123-11CF-B171-00AA0057599E}")
$DBPROPSET_PROVIDERROWSET = GUID$("{497C60E1-7123-11CF-B171-00AA0057599E}")
$DBPROPSET_PROVIDERDBINIT = GUID$("{497C60E2-7123-11CF-B171-00AA0057599E}")
$DBPROPSET_PROVIDERSTMTATTR = GUID$("{497C60E3-7123-11CF-B171-00AA0057599E}")
$DBPROPSET_PROVIDERCONNATTR = GUID$("{497C60E4-7123-11CF-B171-00AA0057599E}")
'#endif // DBINITCONSTANTS
'// PropIds under DBPROPSET_PROVIDERROWSET
%EQUATE `KAGPROP_QUERYBASEDUPDATES = 2
%EQUATE `KAGPROP_MARSHALLABLE = 3
%EQUATE `KAGPROP_POSITIONONNEWROW = 4
%EQUATE `KAGPROP_IRowsetChangeExtInfo = 5
%EQUATE `KAGPROP_CURSOR = 6
%EQUATE `KAGPROP_CONCURRENCY = 7
%EQUATE `KAGPROP_BLOBSONFOCURSOR = 8
%EQUATE `KAGPROP_INCLUDENONEXACT = 9
%EQUATE `KAGPROP_FORCESSFIREHOSEMODE = 10
%EQUATE `KAGPROP_FORCENOPARAMETERREBIND = 11
%EQUATE `KAGPROP_FORCENOPREPARE = 12
%EQUATE `KAGPROP_FORCENOREEXECUTE = 13
'// PropIds under DPBROPSET_PROVIDERDATASOURCEINFO
%EQUATE `KAGPROP_ACCESSIBLEPROCEDURES = 2
%EQUATE `KAGPROP_ACCESSIBLETABLES = 3
%EQUATE `KAGPROP_ODBCSQLOPTIEF = 4
%EQUATE `KAGPROP_OJCAPABILITY = 5
%EQUATE `KAGPROP_PROCEDURES = 6
%EQUATE `KAGPROP_DRIVERNAME = 7
%EQUATE `KAGPROP_DRIVERVER = 8
%EQUATE `KAGPROP_DRIVERODBCVER = 9
%EQUATE `KAGPROP_LIKEESCAPECLAUSE = 10
%EQUATE `KAGPROP_SPECIALCHARACTERS = 11
%EQUATE `KAGPROP_MAXCOLUMNSINGROUPBY = 12
%EQUATE `KAGPROP_MAXCOLUMNSININDEX = 13
%EQUATE `KAGPROP_MAXCOLUMNSINORDERBY = 14
%EQUATE `KAGPROP_MAXCOLUMNSINSELECT = 15
%EQUATE `KAGPROP_MAXCOLUMNSINTABLE = 16
%EQUATE `KAGPROP_NUMERICFUNCTIONS = 17
%EQUATE `KAGPROP_ODBCSQLCONFORMANCE = 18
%EQUATE `KAGPROP_OUTERJOINS = 19
%EQUATE `KAGPROP_STRINGFUNCTIONS = 20
%EQUATE `KAGPROP_SYSTEMFUNCTIONS = 21
%EQUATE `KAGPROP_TIMEDATEFUNCTIONS = 22
%EQUATE `KAGPROP_FILEUSAGE = 23
%EQUATE `KAGPROP_ACTIVESTATEMENTS = 24
'// PropIds under DBPROPSET_PROVIDERDBINIT
%EQUATE `KAGPROP_AUTH_TRUSTEDCONNECTION = 2
%EQUATE `KAGPROP_AUTH_SERVERINTEGRATED = 3
'// Bitmask values for KAGPROP_CONCURRENCY
%EQUATE `KAGPROPVAL_CONCUR_ROWVER = &H00000001
%EQUATE `KAGPROPVAL_CONCUR_VALUES = &H00000002
%EQUATE `KAGPROPVAL_CONCUR_LOCK = &H00000004
%EQUATE `KAGPROPVAL_CONCUR_READ_ONLY = &H00000008
' ########################################################################################
' IRowsetChangeExtInfo interface
' IID = 0C733A8F-2A1C-11CE-ADE5-00AA0044773D
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IRowsetChangeExtInfo_INTERFACE_DEFINED)
%EQUATE `IRowsetChangeExtInfo_INTERFACE_DEFINED = 1
$IID_IRowsetChangeExtInfo = GUID$("{0C733A8F-2A1C-11CE-ADE5-00AA0044773D}")
INTERFACE IRowsetChangeExtInfo $IID_IRowsetChangeExtInfo
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetOriginalRow ( ' VTable offset = 12
 BYVAL hReserved AS DWORD
 , BYVAL hRow AS DWORD
 , BYREF phRowOriginal AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetPendingColumns ( ' VTable offset = 16
 BYVAL hReserved AS DWORD
 , BYVAL hRow AS DWORD
 , BYVAL cColumnOrdinals AS DWORD
 , BYREF rgiOrdinals AS DWORD
 , BYREF rgColumnStatus AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IRowsetChangeExtInfo_INTERFACE_DEFINED__ */
' KAGREQDIAGFLAGSENUM enum
%EQUATE `KAGREQDIAGFLAGS_HEADER = &H1
%EQUATE `KAGREQDIAGFLAGS_RECORD = &H2
'// the structure passed in IRequestDiagFields::RequestDiagFields
' // Size = 8 bytes
TYPE KAGREQDIAG WORD
 ulDiagFlags AS DWORD ' ULONG
 vt AS WORD ' VARTYPE
 sDiagField AS INTEGER ' SHORT
END TYPE
'// the structure passed in IGetDiagField::GetDiagField
' // Size = 32 bytes
TYPE KAGGETDIAG QWORD
 ulSize AS DWORD ' ULONG
 vDiagInfo AS tagVARIANT ' VARIANTARG
 sDiagField AS INTEGER ' SHORT
END TYPE
' ########################################################################################
' ISQLRequestDiagFields interface
' IID = 228972F0-B5FF-11D0-8A80-00C04FD611CD
' Inherited interface = IRowsetChange
' ########################################################################################
#IF NOT %DEF(%ISQLRequestDiagFields_INTERFACE_DEFINED)
%EQUATE `ISQLRequestDiagFields_INTERFACE_DEFINED = 1
$IID_ISQLRequestDiagFields = GUID$("{228972F0-B5FF-11D0-8A80-00C04FD611CD}")
INTERFACE ISQLRequestDiagFields $IID_ISQLRequestDiagFields
 INHERIT IUnknown
 ' =====================================================================================
 METHOD RequestDiagFields ( ' VTable offset = 12
 BYVAL cDiagFields AS DWORD
 , BYREF rgDiagFields AS KAGREQDIAG
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __ISQLRequestDiagFields_INTERFACE_DEFINED__ */
' ########################################################################################
' ISQLGetDiagField interface
' IID = 228972F1-B5FF-11D0-8A80-00C04FD611CD
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%ISQLGetDiagField_INTERFACE_DEFINED)
%EQUATE `ISQLGetDiagField_INTERFACE_DEFINED = 1
$IID_ISQLGetDiagField = GUID$("{228972F1-B5FF-11D0-8A80-00C04FD611CD}")
INTERFACE ISQLGetDiagField $IID_ISQLGetDiagField
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetDiagField ( ' VTable offset = 12
 BYREF pDiagInfo AS KAGREQDIAG
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __ISQLGetDiagField_INTERFACE_DEFINED__ */
#ENDIF
