Can "we", with the built in ADO, connect to a remote Access database, residing on a web server? If so, a hint of where/what (to read) and how to get going on the subject would be highly appreciated. This could become very useful to me as I'm (often) involved in ASP coding as a front-end to Acesss databases on the web. I truly really hate making HTML coded mail to forward information, or a bunch of web forms to add and update content.. The web limitations really get to me sometimes.
I don't have tried myself, because I have not access to a remote database. It must be a matter of using the right connection string.
Example to connect to a remote access database:
"Provider=MS Remote;" & _
"Remote Server=http://myServerName;" & _
"Remote Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\somepath\mydb.mdb", _
"admin", ""
Example for SQLServer:
"Provider=MS Remote;" & _
"Remote Server=http://myServerName;" & _
"Remote Provider=SQLOLEDB;" & _
"Data Source=myServerName;" & _
"Initial Catalog=myDatabaseName;" & _
"User ID=myUsername;" & _
"Password=myPassword"
Here is a link to a collection of connection strings:
http://www.able-consulting.com/ADO_Conn.htm
Hours of searching, reading and playing around with every variation of the connection string syntax that I could come up with gave me nothing but frustration. I'm totally lost, going nowhere, and I can't seem to find very much informative details on the net to help me understand it better. I've got all that is needed (I guess), except the correct connection string and the right knowledge..
Wanna have a go at it?
Then you will need to use Remote Data Services. I guess that you will have to face problems with configurations, permissions and the like. See:
http://support.microsoft.com/kb/q251122/
Here are wrapper functions for Remote Data Services. You will create the DataControl object with RDSCreateObject("RDS.DataControl") and then use the RDSIBindMgr21 and RDSIBindMgr methods and properties. I can't give you a working example, sorry.
' ********************************************************************************************
' Library name: RDS
' Version: 1.5
' Documentation string: Microsoft Remote Data Services 2.7 Library
' Path: D:\Archivos de programa\Archivos comunes\system\msadc\msadco.dll
' Library GUID: {BD96C556-65A3-11D0-983A-00C04FC29E30}
' Help file: D:\Archivos de programa\Archivos comunes\system\msadc\ado210.chm
' Code generated by the TypeLib Viewer v. 2.00 (c) 2004 by Jose Roca
' Date: 24 nov 2004 Time: 02:58:30
' ********************************************************************************************
' ********************************************************************************************
' ProgIDs (Program identifiers)
' ********************************************************************************************
$PROGID_RDSDataControl281 = "RDS.DataControl.2.81"
$PROGID_RDSDataSpace281 = "RDS.DataSpace.2.81"
' ********************************************************************************************
' ClsIDs (Class identifiers)
' ********************************************************************************************
$CLSID_DataControl = GUID$("{BD96C556-65A3-11D0-983A-00C04FC29E33}")
$CLSID_DataSpace = GUID$("{BD96C556-65A3-11D0-983A-00C04FC29E36}")
' ********************************************************************************************
' IIDs (Interface identifiers)
' ********************************************************************************************
$IID_IADCEvents = GUID$("{24785B20-135E-11D1-A2A7-00A0C9082766}")
$IID_IBindMgr21 = GUID$("{BD96C556-65A3-11D0-983A-00C04FC29E31}")
$IID_IBindMgr = GUID$("{49278A16-7447-11D2-ACCB-0000F87A37D8}")
$IID_IDataspace = GUID$("{BD96C556-65A3-11D0-983A-00C04FC29E34}")
' ********************************************************************************************
' ADCExecuteOptionEnum enum
' Number of members: 2
' ********************************************************************************************
%adcExecSync = 1 ' &H00000001
%adcExecAsync = 2 ' &H00000002
' ********************************************************************************************
' ADCFetchOptionEnum enum
' Number of members: 3
' ********************************************************************************************
%adcFetchUpFront = 1 ' &H00000001
%adcFetchBackground = 2 ' &H00000002
%adcFetchAsync = 3 ' &H00000003
' ********************************************************************************************
' ADCReadyStateEnum enum
' Number of members: 3
' ********************************************************************************************
%adcReadyStateLoaded = 2 ' &H00000002
%adcReadyStateInteractive = 3 ' &H00000003
%adcReadyStateComplete = 4 ' &H00000004
' ********************************************************************************************
' Returns a pointer to a specified interface on an object to which a client currently holds an
' interface pointer. This function must call IUnknown_AddRef on the pointer it returns.
' ********************************************************************************************
FUNCTION RDS_QueryInterface (BYVAL pthis AS DWORD PTR, BYREF riid AS GUID, BYREF ppvObj AS DWORD) AS LONG
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[0] USING RDS_QueryInterface(pthis, riid, ppvObj) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' Decrements the reference count for the calling interface on a object. If the reference count
' on the object falls to 0, the object is freed from memory.
' ********************************************************************************************
FUNCTION RDS_Release (BYVAL pthis AS DWORD PTR) AS DWORD
LOCAL DWRESULT AS DWORD
CALL DWORD @@pthis[2] USING RDS_Release(pthis) TO DWRESULT
FUNCTION = DWRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' Creates an instance of an object.
' Parameters:
' strProgID
' Required. String. The ProgID or the CLSID of the object to create.
' ppv
' Required. Dword. Address of pointer variable that receives the interface pointer.
' Upon failure, ppv contains %NULL.
' Return value:
' An HRESULT error or %S_OK
' ********************************************************************************************
FUNCTION RDSCreateObject (BYVAL strProgID AS STRING, BYREF ppv AS DWORD) AS LONG
LOCAL hr AS LONG ' HRESULT
LOCAL pUnknown AS DWORD ' IUnknown pointer
LOCAL pDispatch AS DWORD ' IDispatch pointer
LOCAL IID_NULL AS GUID ' Null GUID
LOCAL IID_IUnknown AS GUID ' Iunknown GUID
LOCAL IID_IDispatch AS GUID ' IDispatch GUID
LOCAL ClassID AS GUID ' CLSID
' Standard interface GUIDs
IID_NULL = GUID$("{00000000-0000-0000-0000-000000000000}")
IID_IUnknown = GUID$("{00000000-0000-0000-c000-000000000046}")
IID_IDispatch = GUID$("{00020400-0000-0000-c000-000000000046}")
' Exit if strProgID is a null string
IF strProgID = "" THEN
FUNCTION = %E_INVALIDARG
EXIT FUNCTION
END IF
' Convert the ProgID in a CLSID
ClassID = CLSID$(strProgID)
' If it fails, see if it is a CLSID
IF ClassID = IID_NULL THEN ClassID = GUID$(strProgID)
' If not a valid ProgID or CLSID return an error
IF ClassID = IID_NULL THEN
FUNCTION = %E_INVALIDARG
EXIT FUNCTION
END IF
' Create an instance of the object
' Context: &H17 (%CLSCTX_ALL) =
' %CLSCTX_INPROC_SERVER OR %CLSCTX_INPROC_HANDLER OR _
' %CLSCTX_LOCAL_SERVER OR %CLSCTX_REMOTE_SERVER
hr = CoCreateInstance(ClassID, BYVAL %NULL, &H17, IID_IUnknown, pUnknown)
IF ISTRUE hr OR ISFALSE pUnknown THEN
FUNCTION = hr
EXIT FUNCTION
END IF
' Ask for the dispatch interface
hr = RDS_QueryInterface(pUnknown, IID_IDispatch, pDispatch)
' If it fails, return the Iunknown interface
IF ISTRUE hr OR ISFALSE pDispatch THEN
ppv = pUnknown
FUNCTION = hr
EXIT FUNCTION
END IF
' Release the IUnknown interface
RDS_Release pUnknown
' Return a pointer to the dispatch interface
ppv = pDispatch
FUNCTION = hr
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' IBindMgr21 interface
' IID: {BD96C556-65A3-11D0-983A-00C04FC29E31}
' Number of functions: 36
' Help string: Definition of interface IBindMgr
' Attributes: 4176 [&H1050] [Hidden] [Dual] [Dispatchable]
' ********************************************************************************************
' ********************************************************************************************
' [get_]SQL property
' Interface name: IBindMgr21
' Help string: Indicates the SQL statement of the query
' Help context: 1231174 [&H0012C946]
' Vtable offset: 28
' DispID: 0 [&H00000000]
' ********************************************************************************************
FUNCTION RDSIBindMgr21_get_SQL ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYREF pbstrQuery AS STRING _ ' *VT_BSTR <DYNAMIC UNICODE STRING> [out]
) AS LONG ' VT_HRESULT <LONG>
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[7] USING RDSIBindMgr21_get_SQL(pthis, pbstrQuery) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' [put_]SQL property
' Interface name: IBindMgr21
' Help string: Indicates the SQL statement of the query
' Help context: 1231174 [&H0012C946]
' Vtable offset: 32
' DispID: 0 [&H00000000]
' ********************************************************************************************
DECLARE FUNCTION Proto_RDSIBindMgr21_put_SQL( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYVAL pbstrQuery AS DWORD _ ' VT_BSTR <DYNAMIC UNICODE STRING> [in]
) AS LONG ' VT_HRESULT <LONG>
FUNCTION RDSIBindMgr21_put_SQL ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYVAL pbstrQuery AS STRING _ ' VT_BSTR <DYNAMIC UNICODE STRING> [in]
) AS LONG ' VT_HRESULT <LONG>
pbstrQuery = UCODE$(pbstrQuery)
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[8] USING Proto_RDSIBindMgr21_put_SQL(pthis, BYVAL STRPTR(pbstrQuery)) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' [get_]Server property
' Interface name: IBindMgr21
' Help string: Indicates the server to execute the query on
' Help context: 1231167 [&H0012C93F]
' Vtable offset: 36
' DispID: 1 [&H00000001]
' ********************************************************************************************
FUNCTION RDSIBindMgr21_get_Server ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYREF pbstrServer AS STRING _ ' *VT_BSTR <DYNAMIC UNICODE STRING> [out]
) AS LONG ' VT_HRESULT <LONG>
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[9] USING RDSIBindMgr21_get_Server(pthis, pbstrServer) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' [put_]Server property
' Interface name: IBindMgr21
' Help string: Indicates the server to execute the query on
' Help context: 1231167 [&H0012C93F]
' Vtable offset: 40
' DispID: 1 [&H00000001]
' ********************************************************************************************
DECLARE FUNCTION Proto_RDSIBindMgr21_put_Server( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYVAL pbstrServer AS DWORD _ ' VT_BSTR <DYNAMIC UNICODE STRING> [in]
) AS LONG ' VT_HRESULT <LONG>
FUNCTION RDSIBindMgr21_put_Server ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYVAL pbstrServer AS STRING _ ' VT_BSTR <DYNAMIC UNICODE STRING> [in]
) AS LONG ' VT_HRESULT <LONG>
pbstrServer = UCODE$(pbstrServer)
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[10] USING Proto_RDSIBindMgr21_put_Server(pthis, BYVAL STRPTR(pbstrServer)) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' [get_]DataSpace property
' Interface name: IBindMgr21
' Help string: Ignored, Exists to maintain backward compatibility
' Vtable offset: 44
' DispID: 144 [&H00000090]
' ********************************************************************************************
FUNCTION RDSIBindMgr21_get_DataSpace ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYREF pbstrDs AS STRING _ ' *VT_BSTR <DYNAMIC UNICODE STRING> [out]
) AS LONG ' VT_HRESULT <LONG>
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[11] USING RDSIBindMgr21_get_DataSpace(pthis, pbstrDs) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' [put_]DataSpace property
' Interface name: IBindMgr21
' Help string: Ignored, Exists to maintain backward compatibility
' Vtable offset: 48
' DispID: 144 [&H00000090]
' ********************************************************************************************
DECLARE FUNCTION Proto_RDSIBindMgr21_put_DataSpace( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYVAL pbstrDs AS DWORD _ ' VT_BSTR <DYNAMIC UNICODE STRING> [in]
) AS LONG ' VT_HRESULT <LONG>
FUNCTION RDSIBindMgr21_put_DataSpace ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYVAL pbstrDs AS STRING _ ' VT_BSTR <DYNAMIC UNICODE STRING> [in]
) AS LONG ' VT_HRESULT <LONG>
pbstrDs = UCODE$(pbstrDs)
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[12] USING Proto_RDSIBindMgr21_put_DataSpace(pthis, BYVAL STRPTR(pbstrDs)) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' [put_]SourceRecordset property
' Interface name: IBindMgr21
' Help string: ADO Recordset object for this data control
' Help context: 1000018 [&H000F4252]
' Vtable offset: 52
' DispID: 146 [&H00000092]
' ********************************************************************************************
FUNCTION RDSIBindMgr21_put_SourceRecordset ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYVAL pDispatch AS DWORD _ ' VT_DISPATCH <IDISPATCH> [in]
) AS LONG ' VT_HRESULT <LONG>
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[13] USING RDSIBindMgr21_put_SourceRecordset(pthis, pDispatch) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' [putref_]SourceRecordset property
' Interface name: IBindMgr21
' Help string: ADO Recordset object for this data control
' Help context: 1000018 [&H000F4252]
' Vtable offset: 56
' DispID: 146 [&H00000092]
' ********************************************************************************************
FUNCTION RDSIBindMgr21_putref_SourceRecordset ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYVAL pDispatch AS DWORD _ ' VT_DISPATCH <IDISPATCH> [in]
) AS LONG ' VT_HRESULT <LONG>
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[14] USING RDSIBindMgr21_putref_SourceRecordset(pthis, pDispatch) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' [get_]Recordset property
' Interface name: IBindMgr21
' Help string: ADO Recordset object for this data control
' Help context: 1231164 [&H0012C93C]
' Vtable offset: 60
' DispID: 149 [&H00000095]
' ********************************************************************************************
FUNCTION RDSIBindMgr21_get_Recordset ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYREF pdispRecordset AS DWORD _ ' *VT_DISPATCH <IDISPATCH> [out]
) AS LONG ' VT_HRESULT <LONG>
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[15] USING RDSIBindMgr21_get_Recordset(pthis, pdispRecordset) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' [get_]Connect property
' Interface name: IBindMgr21
' Help string: Indicates the connect parameters for the query
' Help context: 1231127 [&H0012C917]
' Vtable offset: 64
' DispID: 148 [&H00000094]
' ********************************************************************************************
FUNCTION RDSIBindMgr21_get_Connect ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYREF pbstrConnect AS STRING _ ' *VT_BSTR <DYNAMIC UNICODE STRING> [out]
) AS LONG ' VT_HRESULT <LONG>
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[16] USING RDSIBindMgr21_get_Connect(pthis, pbstrConnect) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' [put_]Connect property
' Interface name: IBindMgr21
' Help string: Indicates the connect parameters for the query
' Help context: 1231127 [&H0012C917]
' Vtable offset: 68
' DispID: 148 [&H00000094]
' ********************************************************************************************
DECLARE FUNCTION Proto_RDSIBindMgr21_put_Connect( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYVAL pbstrConnect AS DWORD _ ' VT_BSTR <DYNAMIC UNICODE STRING> [in]
) AS LONG ' VT_HRESULT <LONG>
FUNCTION RDSIBindMgr21_put_Connect ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYVAL pbstrConnect AS STRING _ ' VT_BSTR <DYNAMIC UNICODE STRING> [in]
) AS LONG ' VT_HRESULT <LONG>
pbstrConnect = UCODE$(pbstrConnect)
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[17] USING Proto_RDSIBindMgr21_put_Connect(pthis, BYVAL STRPTR(pbstrConnect)) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' [get_]ExecuteOptions property
' Interface name: IBindMgr21
' Help string: Indicates the options for executing the query
' Help context: 1231138 [&H0012C922]
' Vtable offset: 72
' DispID: 18 [&H00000012]
' ********************************************************************************************
FUNCTION RDSIBindMgr21_get_ExecuteOptions ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYREF pshExecuteOptions AS INTEGER _ ' *VT_I2 <INTEGER> [out]
) AS LONG ' VT_HRESULT <LONG>
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[18] USING RDSIBindMgr21_get_ExecuteOptions(pthis, pshExecuteOptions) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' [put_]ExecuteOptions property
' Interface name: IBindMgr21
' Help string: Indicates the options for executing the query
' Help context: 1231138 [&H0012C922]
' Vtable offset: 76
' DispID: 18 [&H00000012]
' ********************************************************************************************
FUNCTION RDSIBindMgr21_put_ExecuteOptions ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYVAL pshExecuteOptions AS INTEGER _ ' VT_I2 <INTEGER> [in]
) AS LONG ' VT_HRESULT <LONG>
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[19] USING RDSIBindMgr21_put_ExecuteOptions(pthis, pshExecuteOptions) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' [get_]FetchOptions property
' Interface name: IBindMgr21
' Help string: Indicates the options for fetching data for the query
' Help context: 1231139 [&H0012C923]
' Vtable offset: 80
' DispID: 20 [&H00000014]
' ********************************************************************************************
FUNCTION RDSIBindMgr21_get_FetchOptions ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYREF pshFetchOptions AS INTEGER _ ' *VT_I2 <INTEGER> [out]
) AS LONG ' VT_HRESULT <LONG>
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[20] USING RDSIBindMgr21_get_FetchOptions(pthis, pshFetchOptions) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' [put_]FetchOptions property
' Interface name: IBindMgr21
' Help string: Indicates the options for fetching data for the query
' Help context: 1231139 [&H0012C923]
' Vtable offset: 84
' DispID: 20 [&H00000014]
' ********************************************************************************************
FUNCTION RDSIBindMgr21_put_FetchOptions ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYVAL pshFetchOptions AS INTEGER _ ' VT_I2 <INTEGER> [in]
) AS LONG ' VT_HRESULT <LONG>
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[21] USING RDSIBindMgr21_put_FetchOptions(pthis, pshFetchOptions) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' [get_]ReadyState property
' Interface name: IBindMgr21
' Help string: Indicates the state of the control
' Help context: 1231165 [&H0012C93D]
' Vtable offset: 88
' DispID: -525 [&HFFFFFDF3]
' ********************************************************************************************
FUNCTION RDSIBindMgr21_get_ReadyState ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYREF plState AS LONG _ ' *VT_I4 <LONG> [out]
) AS LONG ' VT_HRESULT <LONG>
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[22] USING RDSIBindMgr21_get_ReadyState(pthis, plState) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' [get_]SortColumn property
' Interface name: IBindMgr21
' Help string: Indicates the column to sort on
' Help context: 1231170 [&H0012C942]
' Vtable offset: 92
' DispID: 11 [&H0000000B]
' ********************************************************************************************
FUNCTION RDSIBindMgr21_get_SortColumn ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYREF pbstrSortColumn AS STRING _ ' *VT_BSTR <DYNAMIC UNICODE STRING> [out]
) AS LONG ' VT_HRESULT <LONG>
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[23] USING RDSIBindMgr21_get_SortColumn(pthis, pbstrSortColumn) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' [put_]SortColumn property
' Interface name: IBindMgr21
' Help string: Indicates the column to sort on
' Help context: 1231170 [&H0012C942]
' Vtable offset: 96
' DispID: 11 [&H0000000B]
' ********************************************************************************************
DECLARE FUNCTION Proto_RDSIBindMgr21_put_SortColumn( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYVAL pbstrSortColumn AS DWORD _ ' VT_BSTR <DYNAMIC UNICODE STRING> [in]
) AS LONG ' VT_HRESULT <LONG>
FUNCTION RDSIBindMgr21_put_SortColumn ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYVAL pbstrSortColumn AS STRING _ ' VT_BSTR <DYNAMIC UNICODE STRING> [in]
) AS LONG ' VT_HRESULT <LONG>
pbstrSortColumn = UCODE$(pbstrSortColumn)
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[24] USING Proto_RDSIBindMgr21_put_SortColumn(pthis, BYVAL STRPTR(pbstrSortColumn)) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' [get_]SortDirection property
' Interface name: IBindMgr21
' Help string: Indicates the direction to sort the column
' Help context: 1231171 [&H0012C943]
' Vtable offset: 100
' DispID: 12 [&H0000000C]
' ********************************************************************************************
FUNCTION RDSIBindMgr21_get_SortDirection ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYREF pfSortAscending AS INTEGER _ ' *VT_BOOL <INTEGER> [out]
) AS LONG ' VT_HRESULT <LONG>
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[25] USING RDSIBindMgr21_get_SortDirection(pthis, pfSortAscending) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' [put_]SortDirection property
' Interface name: IBindMgr21
' Help string: Indicates the direction to sort the column
' Help context: 1231171 [&H0012C943]
' Vtable offset: 104
' DispID: 12 [&H0000000C]
' ********************************************************************************************
FUNCTION RDSIBindMgr21_put_SortDirection ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYVAL pfSortAscending AS INTEGER _ ' VT_BOOL <INTEGER> [in]
) AS LONG ' VT_HRESULT <LONG>
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[26] USING RDSIBindMgr21_put_SortDirection(pthis, pfSortAscending) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' [get_]FilterValue property
' Interface name: IBindMgr21
' Help string: Indicates the value to filter with
' Help context: 1231143 [&H0012C927]
' Vtable offset: 108
' DispID: 15 [&H0000000F]
' ********************************************************************************************
FUNCTION RDSIBindMgr21_get_FilterValue ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYREF pbstrFilterValue AS STRING _ ' *VT_BSTR <DYNAMIC UNICODE STRING> [out]
) AS LONG ' VT_HRESULT <LONG>
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[27] USING RDSIBindMgr21_get_FilterValue(pthis, pbstrFilterValue) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' [put_]FilterValue property
' Interface name: IBindMgr21
' Help string: Indicates the value to filter with
' Help context: 1231143 [&H0012C927]
' Vtable offset: 112
' DispID: 15 [&H0000000F]
' ********************************************************************************************
DECLARE FUNCTION Proto_RDSIBindMgr21_put_FilterValue( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYVAL pbstrFilterValue AS DWORD _ ' VT_BSTR <DYNAMIC UNICODE STRING> [in]
) AS LONG ' VT_HRESULT <LONG>
FUNCTION RDSIBindMgr21_put_FilterValue ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYVAL pbstrFilterValue AS STRING _ ' VT_BSTR <DYNAMIC UNICODE STRING> [in]
) AS LONG ' VT_HRESULT <LONG>
pbstrFilterValue = UCODE$(pbstrFilterValue)
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[28] USING Proto_RDSIBindMgr21_put_FilterValue(pthis, BYVAL STRPTR(pbstrFilterValue)) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' [get_]FilterCriterion property
' Interface name: IBindMgr21
' Help string: Indicates the criteria of the filter
' Help context: 1231142 [&H0012C926]
' Vtable offset: 116
' DispID: 14 [&H0000000E]
' ********************************************************************************************
FUNCTION RDSIBindMgr21_get_FilterCriterion ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYREF pbstrFilterCriterion AS STRING _ ' *VT_BSTR <DYNAMIC UNICODE STRING> [out]
) AS LONG ' VT_HRESULT <LONG>
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[29] USING RDSIBindMgr21_get_FilterCriterion(pthis, pbstrFilterCriterion) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' [put_]FilterCriterion property
' Interface name: IBindMgr21
' Help string: Indicates the criteria of the filter
' Help context: 1231142 [&H0012C926]
' Vtable offset: 120
' DispID: 14 [&H0000000E]
' ********************************************************************************************
DECLARE FUNCTION Proto_RDSIBindMgr21_put_FilterCriterion( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYVAL pbstrFilterCriterion AS DWORD _ ' VT_BSTR <DYNAMIC UNICODE STRING> [in]
) AS LONG ' VT_HRESULT <LONG>
FUNCTION RDSIBindMgr21_put_FilterCriterion ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYVAL pbstrFilterCriterion AS STRING _ ' VT_BSTR <DYNAMIC UNICODE STRING> [in]
) AS LONG ' VT_HRESULT <LONG>
pbstrFilterCriterion = UCODE$(pbstrFilterCriterion)
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[30] USING Proto_RDSIBindMgr21_put_FilterCriterion(pthis, BYVAL STRPTR(pbstrFilterCriterion)) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' [get_]FilterColumn property
' Interface name: IBindMgr21
' Help string: Indicates the column to filter on
' Help context: 1231141 [&H0012C925]
' Vtable offset: 124
' DispID: 13 [&H0000000D]
' ********************************************************************************************
FUNCTION RDSIBindMgr21_get_FilterColumn ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYREF pbstrFilterColumn AS STRING _ ' *VT_BSTR <DYNAMIC UNICODE STRING> [out]
) AS LONG ' VT_HRESULT <LONG>
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[31] USING RDSIBindMgr21_get_FilterColumn(pthis, pbstrFilterColumn) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' [put_]FilterColumn property
' Interface name: IBindMgr21
' Help string: Indicates the column to filter on
' Help context: 1231141 [&H0012C925]
' Vtable offset: 128
' DispID: 13 [&H0000000D]
' ********************************************************************************************
DECLARE FUNCTION Proto_RDSIBindMgr21_put_FilterColumn( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYVAL pbstrFilterColumn AS DWORD _ ' VT_BSTR <DYNAMIC UNICODE STRING> [in]
) AS LONG ' VT_HRESULT <LONG>
FUNCTION RDSIBindMgr21_put_FilterColumn ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYVAL pbstrFilterColumn AS STRING _ ' VT_BSTR <DYNAMIC UNICODE STRING> [in]
) AS LONG ' VT_HRESULT <LONG>
pbstrFilterColumn = UCODE$(pbstrFilterColumn)
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[32] USING Proto_RDSIBindMgr21_put_FilterColumn(pthis, BYVAL STRPTR(pbstrFilterColumn)) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' Refresh method
' Interface name: IBindMgr21
' Help string: Refresh the data source
' Help context: 1231067 [&H0012C8DB]
' Vtable offset: 132
' DispID: 6 [&H00000006]
' ********************************************************************************************
FUNCTION RDSIBindMgr21_Refresh ( _
BYVAL pthis AS DWORD PTR _ ' VT_PTR <*VT_UNKNOWN>
) AS LONG ' VT_HRESULT <LONG>
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[33] USING RDSIBindMgr21_Refresh(pthis) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' SubmitChanges method
' Interface name: IBindMgr21
' Help string: Send changes to the RDSServer.DataFactory
' Help context: 1231072 [&H0012C8E0]
' Vtable offset: 136
' DispID: 7 [&H00000007]
' ********************************************************************************************
FUNCTION RDSIBindMgr21_SubmitChanges ( _
BYVAL pthis AS DWORD PTR _ ' VT_PTR <*VT_UNKNOWN>
) AS LONG ' VT_HRESULT <LONG>
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[34] USING RDSIBindMgr21_SubmitChanges(pthis) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' CancelUpdate method
' Interface name: IBindMgr21
' Help string: Cancel changes made to the source recordset
' Help context: 1231036 [&H0012C8BC]
' Vtable offset: 140
' DispID: 8 [&H00000008]
' ********************************************************************************************
FUNCTION RDSIBindMgr21_CancelUpdate ( _
BYVAL pthis AS DWORD PTR _ ' VT_PTR <*VT_UNKNOWN>
) AS LONG ' VT_HRESULT <LONG>
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[35] USING RDSIBindMgr21_CancelUpdate(pthis) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' CreateRecordSet method
' Interface name: IBindMgr21
' Help string: Create an empty recordset
' Help context: 1231043 [&H0012C8C3]
' Vtable offset: 144
' DispID: 10 [&H0000000A]
' ********************************************************************************************
FUNCTION RDSIBindMgr21_CreateRecordSet ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYVAL varColumnInfos AS VARIANT, _ ' VT_VARIANT <VARIANT> [in]
BYREF ppRecordSet AS DWORD _ ' *VT_DISPATCH <IDISPATCH> [out]
) AS LONG ' VT_HRESULT <LONG>
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[36] USING RDSIBindMgr21_CreateRecordSet(pthis, varColumnInfos, ppRecordSet) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' Reset method
' Interface name: IBindMgr21
' Help string: Reset rowset based on filter and sort criteria
' Help context: 1231069 [&H0012C8DD]
' Vtable offset: 148
' DispID: 16 [&H00000010]
' ********************************************************************************************
FUNCTION RDSIBindMgr21_Reset ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYVAL fRefilter AS LONG _ ' VT_I4 <LONG> [opt] [hasdefault] [default value = 1]
) AS LONG ' VT_HRESULT <LONG>
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[37] USING RDSIBindMgr21_Reset(pthis, fRefilter) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' Cancel method
' Interface name: IBindMgr21
' Help string: Cancels asynchronous action
' Help context: 1231033 [&H0012C8B9]
' Vtable offset: 152
' DispID: 17 [&H00000011]
' ********************************************************************************************
FUNCTION RDSIBindMgr21_Cancel ( _
BYVAL pthis AS DWORD PTR _ ' VT_PTR <*VT_UNKNOWN>
) AS LONG ' VT_HRESULT <LONG>
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[38] USING RDSIBindMgr21_Cancel(pthis) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' [get_]Handler property
' Interface name: IBindMgr21
' Help string: Indicates what handler to use
' Help context: 1231144 [&H0012C928]
' Vtable offset: 156
' DispID: 21 [&H00000015]
' ********************************************************************************************
FUNCTION RDSIBindMgr21_get_Handler ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYREF pbstrHandler AS STRING _ ' *VT_BSTR <DYNAMIC UNICODE STRING> [out]
) AS LONG ' VT_HRESULT <LONG>
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[39] USING RDSIBindMgr21_get_Handler(pthis, pbstrHandler) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' [put_]Handler property
' Interface name: IBindMgr21
' Help string: Indicates what handler to use
' Help context: 1231144 [&H0012C928]
' Vtable offset: 160
' DispID: 21 [&H00000015]
' ********************************************************************************************
DECLARE FUNCTION Proto_RDSIBindMgr21_put_Handler( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYVAL pbstrHandler AS DWORD _ ' VT_BSTR <DYNAMIC UNICODE STRING> [in]
) AS LONG ' VT_HRESULT <LONG>
FUNCTION RDSIBindMgr21_put_Handler ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYVAL pbstrHandler AS STRING _ ' VT_BSTR <DYNAMIC UNICODE STRING> [in]
) AS LONG ' VT_HRESULT <LONG>
pbstrHandler = UCODE$(pbstrHandler)
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[40] USING Proto_RDSIBindMgr21_put_Handler(pthis, BYVAL STRPTR(pbstrHandler)) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' [get_]InternetTimeout property
' Interface name: IBindMgr21
' Help string: Indicates the timeout (in milliseconds) for HTTP transmissions
' Help context: 1235903 [&H0012DBBF]
' Vtable offset: 164
' DispID: 22 [&H00000016]
' ********************************************************************************************
FUNCTION RDSIBindMgr21_get_InternetTimeout ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYREF plInetTimeout AS LONG _ ' *VT_I4 <LONG> [out]
) AS LONG ' VT_HRESULT <LONG>
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[41] USING RDSIBindMgr21_get_InternetTimeout(pthis, plInetTimeout) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' [put_]InternetTimeout property
' Interface name: IBindMgr21
' Help string: Indicates the timeout (in milliseconds) for HTTP transmissions
' Help context: 1235903 [&H0012DBBF]
' Vtable offset: 168
' DispID: 22 [&H00000016]
' ********************************************************************************************
FUNCTION RDSIBindMgr21_put_InternetTimeout ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYVAL plInetTimeout AS LONG _ ' VT_I4 <LONG> [in]
) AS LONG ' VT_HRESULT <LONG>
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[42] USING RDSIBindMgr21_put_InternetTimeout(pthis, plInetTimeout) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' IBindMgr interface
' IID: {49278A16-7447-11D2-ACCB-0000F87A37D8}
' Number of functions: 2
' Help string: Definition of interface IBindMgr
' Attributes: 4176 [&H1050] [Hidden] [Dual] [Dispatchable]
' ********************************************************************************************
' ********************************************************************************************
' [get_]URL property
' Interface name: IBindMgr
' Help string: URL to an asp page which returns a Recordset through response.stream
' Vtable offset: 172
' DispID: 23 [&H00000017]
' ********************************************************************************************
FUNCTION RDSIBindMgr_get_URL ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYREF pbstrURL AS STRING _ ' *VT_BSTR <DYNAMIC UNICODE STRING> [out]
) AS LONG ' VT_HRESULT <LONG>
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[43] USING RDSIBindMgr_get_URL(pthis, pbstrURL) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' [put_]URL property
' Interface name: IBindMgr
' Help string: URL to an asp page which returns a Recordset through response.stream
' Vtable offset: 176
' DispID: 23 [&H00000017]
' ********************************************************************************************
DECLARE FUNCTION Proto_RDSIBindMgr_put_URL( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYVAL pbstrURL AS DWORD _ ' VT_BSTR <DYNAMIC UNICODE STRING> [in]
) AS LONG ' VT_HRESULT <LONG>
FUNCTION RDSIBindMgr_put_URL ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYVAL pbstrURL AS STRING _ ' VT_BSTR <DYNAMIC UNICODE STRING> [in]
) AS LONG ' VT_HRESULT <LONG>
pbstrURL = UCODE$(pbstrURL)
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[44] USING Proto_RDSIBindMgr_put_URL(pthis, BYVAL STRPTR(pbstrURL)) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' IDataspace interface
' IID: {BD96C556-65A3-11D0-983A-00C04FC29E34}
' Number of functions: 3
' Help string: Definition of interface IDataspace
' Attributes: 4176 [&H1050] [Hidden] [Dual] [Dispatchable]
' ********************************************************************************************
' ********************************************************************************************
' CreateObject method
' Interface name: IDataspace
' Help string: Creates a business object of the specified Progid over the specified connection
' Help context: 1231041 [&H0012C8C1]
' Vtable offset: 28
' DispID: 1 [&H00000001]
' ********************************************************************************************
DECLARE FUNCTION Proto_RDSIDataspace_CreateObject( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYVAL bstrProgid AS DWORD, _ ' VT_BSTR <DYNAMIC UNICODE STRING> [in]
BYVAL bstrConnection AS DWORD, _ ' VT_BSTR <DYNAMIC UNICODE STRING> [in]
BYREF pvarResult AS VARIANT _ ' *VT_VARIANT <VARIANT> [out]
) AS LONG ' VT_HRESULT <LONG>
FUNCTION RDSIDataspace_CreateObject ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYVAL bstrProgid AS STRING, _ ' VT_BSTR <DYNAMIC UNICODE STRING> [in]
BYVAL bstrConnection AS STRING, _ ' VT_BSTR <DYNAMIC UNICODE STRING> [in]
BYREF pvarResult AS VARIANT _ ' *VT_VARIANT <VARIANT> [out]
) AS LONG ' VT_HRESULT <LONG>
bstrProgid = UCODE$(bstrProgid)
bstrConnection = UCODE$(bstrConnection)
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[7] USING Proto_RDSIDataspace_CreateObject(pthis, BYVAL STRPTR(bstrProgid), BYVAL STRPTR(bstrConnection), pvarResult) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' [get_]InternetTimeout property
' Interface name: IDataspace
' Help string: Indicates the timeout (in milliseconds) for HTTP transmissions
' Help context: 1235903 [&H0012DBBF]
' Vtable offset: 32
' DispID: 222 [&H000000DE]
' ********************************************************************************************
FUNCTION RDSIDataspace_get_InternetTimeout ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYREF plInetTimeout AS LONG _ ' *VT_I4 <LONG> [out]
) AS LONG ' VT_HRESULT <LONG>
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[8] USING RDSIDataspace_get_InternetTimeout(pthis, plInetTimeout) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' [put_]InternetTimeout property
' Interface name: IDataspace
' Help string: Indicates the timeout (in milliseconds) for HTTP transmissions
' Help context: 1235903 [&H0012DBBF]
' Vtable offset: 36
' DispID: 222 [&H000000DE]
' ********************************************************************************************
FUNCTION RDSIDataspace_put_InternetTimeout ( _
BYVAL pthis AS DWORD PTR, _ ' VT_PTR <*VT_UNKNOWN>
BYVAL plInetTimeout AS LONG _ ' VT_I4 <LONG> [in]
) AS LONG ' VT_HRESULT <LONG>
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[9] USING RDSIDataspace_put_InternetTimeout(pthis, plInetTimeout) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
And the code for the events:
' ********************************************************************************************
' OnEvent Functions
' Code generated by the TypeLib Viewer v. 2.00 (c) 2003-2004 by Jose Roca
' Date: 24 nov 2004 Time: 03:16:10
' ********************************************************************************************
' ********************************************************************************************
' Variants can hold any kind of numeric values. When returning one of these values you can
' assign them directly, e.g. @pvapi[1].vd.@plVal = -1, but when you need to assign an string
' or a variant you need to declare a variable of the appropiate kind and pass his address with
' VARPTR. Strings must be converted to unicode with UCODE$. You have to manipulate the variant
' using pointers because when you assign a value to a byref variant with PB, the variant loses
' his byref flag and PB doesn't provide a way to set it.
' ********************************************************************************************
' ********************************************************************************************
' IADCEvents dispatch interface
' IID = {24785B20-135E-11D1-A2A7-00A0C9082766}
' Help string = Definition of interface IADCEvents
' Attributes = 4112 [&H1010] [Hidden] [Dispatchable]
' Number of functions = 2
' ********************************************************************************************
' ********************************************************************************************
' EXCEPINFO structure
' ********************************************************************************************
TYPE RDSIADCEvents_EXCEPINFO
wCode AS WORD ' An error code describing the error.
wReserved AS WORD ' Reserved
bstrSource AS DWORD ' Source of the exception.
bstrDescription AS DWORD ' Textual description of the error.
bstrHelpFile AS DWORD ' Help file path.
dwHelpContext AS DWORD ' Help context ID.
pvReserved AS DWORD ' Reserved.
pfnDeferredFillIn AS DWORD ' Pointer to function that fills in Help and description info.
scode AS DWORD ' An error code describing the error.
END TYPE
' ********************************************************************************************
' ********************************************************************************************
' Returns a pointer to a specified interface on an object to which a client currently holds an
' interface pointer.
' ********************************************************************************************
FUNCTION RDSIADCEvents_IUnknown_QueryInterface (BYVAL pthis AS DWORD PTR, _
BYREF riid AS GUID, BYREF ppvObj AS DWORD) AS DWORD
LOCAL HRESULT AS DWORD
CALL DWORD @@pthis[0] USING RDSIADCEvents_IUnknown_QueryInterface(pthis, riid, ppvObj) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' Decrements the reference count for the calling interface on a object. If the reference count
' on the object falls to 0, the object is freed from memory.
' ********************************************************************************************
FUNCTION RDSIADCEvents_IUnknown_Release (BYVAL pthis AS DWORD PTR) AS DWORD
LOCAL HRESULT AS DWORD
CALL DWORD @@pthis[2] USING RDSIADCEvents_IUnknown_Release(pthis) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' IConnectionPointContainer::FindConnectionPoint
' Returns a pointer to the IConnectionPoint interface of a connection point for a specified IID,
' if that IID describes a supported outgoing interface.
' ********************************************************************************************
FUNCTION RDSIADCEvents_IConnectionPointContainer_FindConnectionPoint ( _
BYVAL pthis AS DWORD PTR, BYREF riid AS GUID, BYREF ppCP AS DWORD) AS DWORD
LOCAL HRESULT AS DWORD
CALL DWORD @@pthis[4] USING RDSIADCEvents_IConnectionPointContainer_FindConnectionPoint(pthis, riid, ppCP) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' IConnectionPoint::Advise
' Establishes a connection between the connection point object and the client's sink.
' ********************************************************************************************
FUNCTION RDSIADCEvents_IConnectionPoint_Advise (BYVAL pthis AS DWORD PTR, _
BYVAL pUnkSink AS DWORD, BYREF pdwCookie AS DWORD) AS DWORD
LOCAL HRESULT AS DWORD
CALL DWORD @@pthis[5] USING RDSIADCEvents_IConnectionPoint_Advise(pthis, pUnkSink, pdwCookie) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' IConnectionPoint::Unadvise
' Terminates an advisory connection previously established through IConnectionPoint_Advise.
' The dwCookie parameter identifies the connection to terminate.
' ********************************************************************************************
FUNCTION RDSIADCEvents_IConnectionPoint_Unadvise (BYVAL pthis AS DWORD PTR, BYVAL dwCookie AS DWORD) AS DWORD
LOCAL HRESULT AS DWORD
CALL DWORD @@pthis[6] USING RDSIADCEvents_IConnectionPoint_Unadvise(pthis, dwCookie) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' IDispatch virtual table
' ********************************************************************************************
TYPE RDSIADCEvents_IDispatchVtbl
QueryInterface AS DWORD ' Returns pointers to supported interfaces
AddRef AS DWORD ' Increments reference count
Release AS DWORD ' Decrements reference count
GetTypeInfoCount AS DWORD ' Retrieves the number of type descriptions
GetTypeInfo AS DWORD ' Retrieves a description of object's programmable interface
GetIDsOfNames AS DWORD ' Maps name of method or property to DispId
Invoke AS DWORD ' Calls one of the object's methods, or gets/sets one of its properties
pVtblAddr AS DWORD ' Address of the virtual table
cRef AS DWORD ' Reference counter
pthis AS DWORD ' IUnknown or IDispatch of the control that fires the events
END TYPE
' ********************************************************************************************
' ********************************************************************************************
' UI4 AddRef()
' Increments the reference counter.
' ********************************************************************************************
FUNCTION RDSIADCEvents_AddRef (BYVAL pCookie AS RDSIADCEvents_IDispatchVtbl PTR) AS DWORD
INCR @@pCookie.cRef
FUNCTION = @@pCookie.cRef
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' HRESULT QueryInterface([in] *GUID riid, [out] **VOID ppvObj)
' Returns the IUnknown of our class and increments the reference counter.
' ********************************************************************************************
FUNCTION RDSIADCEvents_QueryInterface (BYVAL pCookie AS RDSIADCEvents_IDispatchVtbl PTR, _
BYREF riid AS GUID, BYREF ppvObj AS DWORD) AS DWORD
ppvObj = pCookie
RDSIADCEvents_AddRef pCookie
FUNCTION = %S_OK
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' UI4 Release()
' Releases our class if there is only a reference to him and decrements the reference counter.
' ********************************************************************************************
FUNCTION RDSIADCEvents_Release (BYVAL pCookie AS RDSIADCEvents_IDispatchVtbl PTR) AS DWORD
LOCAL pVtblAddr AS DWORD
IF @@pCookie.cRef = 1 THEN
pVtblAddr = @@pCookie.pVtblAddr
IF ISFALSE HeapFree(GetProcessHeap(), 0, BYVAL pVtblAddr) THEN
FUNCTION = @@pCookie.cRef
EXIT FUNCTION
END IF
END IF
DECR @@pCookie.cRef
FUNCTION = @@pCookie.cRef
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' HRESULT GetTypeInfoCount([out] *UINT pctinfo)
' ********************************************************************************************
FUNCTION RDSIADCEvents_GetTypeInfoCount (BYVAL pCookie AS RDSIADCEvents_IDispatchVtbl PTR, BYREF pctInfo AS DWORD) AS DWORD
FUNCTION = %E_NOTIMPL
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' HRESULT GetTypeInfo([in] UINT itinfo, [in] UI4 lcid, [out] **VOID pptinfo)
' ********************************************************************************************
FUNCTION RDSIADCEvents_GetTypeInfo (BYVAL pCookie AS RDSIADCEvents_IDispatchVtbl PTR, _
BYVAL itinfo AS DWORD, BYVAL lcid AS DWORD, BYREF pptinfo AS DWORD) AS DWORD
FUNCTION = %E_NOTIMPL
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' HRESULT GetIDsOfNames([in] *GUID riid, [in] **I1 rgszNames, [in] UINT cNames, [in] UI4 lcid, [out] *I4 rgdispid)
' ********************************************************************************************
FUNCTION RDSIADCEvents_GetIDsOfNames ( BYVAL pCookie AS RDSIADCEvents_IDispatchVtbl PTR, _
BYREF riid AS GUID, BYVAL rgszNames AS DWORD, BYVAL cNames AS DWORD, BYVAL lcid AS DWORD, BYREF rgdispid AS LONG) AS DWORD
FUNCTION = %E_NOTIMPL
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' Builds the IDispatch Virtual Table
' ********************************************************************************************
FUNCTION RDSIADCEvents_BuildVtbl (BYVAL pthis AS DWORD) AS DWORD
LOCAL pVtbl AS RDSIADCEvents_IDispatchVtbl PTR
LOCAL pUnk AS RDSIADCEvents_IDispatchVtbl PTR
pVtbl = HeapAlloc(GetProcessHeap(), %HEAP_ZERO_MEMORY, SIZEOF(@pVtbl))
IF pVtbl = 0 THEN EXIT FUNCTION
@pVtbl.QueryInterface = CODEPTR(RDSIADCEvents_QueryInterface)
@pVtbl.AddRef = CODEPTR(RDSIADCEvents_AddRef)
@pVtbl.Release = CODEPTR(RDSIADCEvents_Release)
@pVtbl.GetTypeInfoCount = CODEPTR(RDSIADCEvents_GetTypeInfoCount)
@pVtbl.GetTypeInfo = CODEPTR(RDSIADCEvents_GetTypeInfo)
@pVtbl.GetIDsOfNames = CODEPTR(RDSIADCEvents_GetIDsOfNames)
@pVtbl.Invoke = CODEPTR(RDSIADCEvents_Invoke)
@pVtbl.pVtblAddr = pVtbl
@pVtbl.pthis = pthis
pUnk = VARPTR(@pVtbl.pVtblAddr)
FUNCTION = pUnk
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' Establishes a connection between the connection point object and the client's sink.
' Returns a token that uniquely identifies this connection.
' ********************************************************************************************
FUNCTION RDSIADCEvents_ConnectEvents (BYVAL pthis AS DWORD, BYREF pdwCookie AS DWORD) AS LONG
LOCAL HRESULT AS DWORD ' HRESULT code
LOCAL pCPC AS DWORD ' IConnectionPointContainer
LOCAL pCP AS DWORD ' IConnectionPoint
LOCAL IID_CPC AS GUID ' IID_IConnectionPointContainer
LOCAL IID_CP AS GUID ' Events dispinterface
LOCAL dwCookie AS DWORD ' Returned token
LOCAL pUnkSink AS DWORD ' IUnknown of the class
IID_CPC = GUID$("{B196B284-BAB4-101A-B69C-00AA00341D07}")
IID_CP = GUID$("{24785B20-135E-11D1-A2A7-00A0C9082766}")
IF pthis = 0 THEN FUNCTION = -1 : EXIT FUNCTION
HRESULT = RDSIADCEvents_IUnknown_QueryInterface(pthis, IID_CPC, pCPC)
IF HRESULT <> %S_OK THEN FUNCTION = HRESULT : EXIT FUNCTION
HRESULT = RDSIADCEvents_IConnectionPointContainer_FindConnectionPoint(pCPC, IID_CP, pCP)
RDSIADCEvents_IUnknown_Release pCPC
IF HRESULT <> %S_OK THEN FUNCTION = HRESULT : EXIT FUNCTION
pUnkSink = RDSIADCEvents_BuildVtbl(pthis)
IF ISTRUE pUnkSink THEN HRESULT = RDSIADCEvents_IConnectionPoint_Advise(pCP, pUnkSink, dwCookie)
RDSIADCEvents_IUnknown_Release pCP
pdwCookie = dwCookie
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' Releases the events connection identified with the cookie returned by the ConnectEvents function
' ********************************************************************************************
FUNCTION RDSIADCEvents_DisconnectEvents (BYVAL pthis AS DWORD, BYVAL dwCookie AS DWORD) AS LONG
LOCAL HRESULT AS DWORD ' HRESULT code
LOCAL pCPC AS DWORD ' IConnectionPointContainer
LOCAL pCP AS DWORD ' IConnectionPoint
LOCAL IID_CPC AS GUID ' IID_IConnectionPointContainer
LOCAL IID_CP AS GUID ' ConnectionEvents dispinterface
IID_CPC = GUID$("{B196B284-BAB4-101A-B69C-00AA00341D07}")
IID_CP = GUID$("{24785B20-135E-11D1-A2A7-00A0C9082766}")
IF pthis = 0 THEN FUNCTION = -1 : EXIT FUNCTION
HRESULT = RDSIADCEvents_IUnknown_QueryInterface(pthis, IID_CPC, pCPC)
IF HRESULT <> %S_OK THEN FUNCTION = HRESULT : EXIT FUNCTION
HRESULT = RDSIADCEvents_IConnectionPointContainer_FindConnectionPoint(pCPC, IID_CP, pCP)
RDSIADCEvents_IUnknown_Release pCPC
IF HRESULT <> %S_OK THEN FUNCTION = HRESULT : EXIT FUNCTION
HRESULT = RDSIADCEvents_IConnectionPoint_Unadvise(pCP, dwCookie)
RDSIADCEvents_IUnknown_Release pCP
FUNCTION = HRESULT
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' Function name: onreadystatechange
' Dispatch interface name: IADCEvents
' Help context = 1235685 [&H12DAE5]
' Member identifier: -609
' ********************************************************************************************
FUNCTION RDSIADCEvents_onreadystatechange (BYVAL pCookie AS DWORD PTR, BYREF pdispparams AS DISPPARAMS) AS LONG
' ==============================================================================
' Retrieve the IUnknown or IDispatch of the control that has fired the event.
' ==============================================================================
LOCAL pthis AS DWORD
pthis = @@pCookie.pthis
' ==============================================================================
' ==============================================================================
' *** Put your code here ***
' ==============================================================================
FUNCTION = %S_OK
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' Function name: onerror
' Dispatch interface name: IADCEvents
' Help context = 1235686 [&H12DAE6]
' Member identifier: -608
' ********************************************************************************************
FUNCTION RDSIADCEvents_onerror (BYVAL pCookie AS DWORD PTR, BYREF pdispparams AS DISPPARAMS) AS LONG
' ==============================================================================
' Retrieve the IUnknown or IDispatch of the control that has fired the event.
' ==============================================================================
LOCAL pthis AS DWORD
pthis = @@pCookie.pthis
' ==============================================================================
' ==============================================================================
' Parameters in DISPPARAMS are zero based and in reverse order
' ==============================================================================
LOCAL pv AS VARIANT PTR, pvapi AS VARIANTAPI PTR
pv = pdispparams.VariantArgs : pvapi = pv
LOCAL SCode AS INTEGER
SCode = VARIANT#(@pv[3])
LOCAL Description AS STRING
Description = VARIANT$(@pv[2])
LOCAL Source AS STRING
Source = VARIANT$(@pv[1])
LOCAL CancelDisplay AS INTEGER
CancelDisplay = VARIANT#(@pv[0])
' ==============================================================================
' *** Put your code here ***
' ==============================================================================
FUNCTION = %S_OK
END FUNCTION
' ********************************************************************************************
' ********************************************************************************************
' HRESULT Invoke([in] I4 dispidMember, [in] *GUID riid, [in] UI4 lcid, [in] UI2 wFlags, [in] *DISPPARAMS pdispparams, [out] *VARIANT pvarResult, [out] *EXCEPINFO pexcepinfo, [out] *UINT puArgErr)
' ********************************************************************************************
FUNCTION RDSIADCEvents_Invoke (BYVAL pCookie AS RDSIADCEvents_IDispatchVtbl PTR, BYVAL dispidMember AS LONG, BYREF riid AS GUID, _
BYVAL lcid AS DWORD, BYVAL wFlags AS WORD, BYREF pdispparams AS DISPPARAMS, BYREF pvarResult AS VARIANT, _
BYREF pexcepinfo AS RDSIADCEvents_EXCEPINFO, BYREF puArgErr AS DWORD) AS DWORD
FUNCTION = %S_OK
IF VARPTR(pdispparams) THEN
SELECT CASE AS LONG dispidMember
CASE &H12DAE5 ' (1235685) ' // onreadystatechange
FUNCTION = RDSIADCEvents_onreadystatechange(pCookie, pdispparams)
CASE &H12DAE6 ' (1235686) ' // onerror
FUNCTION = RDSIADCEvents_onerror(pCookie, pdispparams)
END SELECT
END IF
END FUNCTION
' ********************************************************************************************
Eeh.. WOW! :shock:
Guess I'll have to wake up properly before I try to have a look at this..