|
Knowledge baseADOADO = ActiveX Data Objects. This section only explains how to interface the Connection Client ActiveX, from a programmer's perspective. Mainly, by calling a function in this client you will have to pass a ADO recordset to this function, containing the data to be transferred. If you do not understand what ADO is, and how to create recordsets with it, we recommend you to read the MSDN pages of Microsoft. We explain the mechanism with the next VB program: Private Sub Mybutton_Click() This routine was written under a button. It makes an ODBC connection with DSN=DemoMaster, and logs on the database with user demomaster who's password is simply password. In this database there is a table ITEM_MASTER of which we want to pass 2 columns in the ADO: MATERIAL_ID and MATERIAL_DESC. We filter the recordset to show that only the filtered recordset is interpreted by PRODBX. Create the ADORecordset object. You may also create this on a different machine like: Set PRODBX = CreateObject("Connection_Client_ActiveX.ADORecordset","PROMESSERVER") Make sure the PRODBX connection client ActiveX is running, before running the code. If you don't, you will get errors because the module is missing specific command line parameters. If you have problems creating the object, or finding the 'ADORecordset' does not appear as a class in your VB, then check if you did:
The last parameter to give the function is the instruction type:
If you mixed up INSERT or UPDATE, PRODBX will automatically correct. COMMAND type will switch the destination connection client to 'Polling time fast', which is bringing it in a mode it waits for an answer. The function returns True when it was able to handle the ADO. This is not equal to 'successfully transferred the data'. When the function returns False it also logged an error #5087. Use the Logging manager to view the reason of your error. Performance noteWhen passing your ADO to the connection client you will encounter that the function is not released unless all records are interpreted. This is because the ownership of the ADO object remains in your application. If you want to prevent this, you must use RDS (Remote Data Service). This will allow you to pass the object completely to the connection client. However, make sure you do not call the function any more before your previous recordset is interpreted. If you do, your previous recordset is overwritten, and you loose the not interpreted data. Learn more about RDS in the MSDN of Microsoft.
|
|||||||||||||||||||
PROMES BVBA - Laarsebeekdreef 14 2900 Schoten Belgium Tel: +32 475 87 69 38 - E-mail: info@promes.be |
||||||||||||||||||||