ACE Wrappers for Xbase++
    Advantage Database



    This Library provides a native interface to the ACE32.DLL (Advantage Client Engine) from Extended Systems. By simply modifying the ADS.INI file, the Advantage Client Engine will allow you to connect to either the Advantage Local Server (ALS) or the Advantage Database Server (ADS). When connected to ADS, your app will be running in true client/server mode. Both the ALS and ADS are mature products that will provide your Xbase++ app with great performance and reliability.

    In order to use the ACE wrappers, you will need to download the Advantage Client Engine DLLs from: http://sqlexpress.net/ace/ace32dll.zip Once downloaded, unzip all files in the same directory where your sample executables are located. You may also wish to download the ACE SDK help file from the Advantage Database solutions website (you will need to create a login id first): http://solutions.advantagedatabase.com/as/advantage_solutions.exe/login

    Although not a true DBE like the Alaska Software ADSDBE, this library performs its magic by using the very powerful Xbase++ preprocessor to translate certain Xbase++ commands and functions to specific ACE Wrapper functions. All of these preprocessor macros are defined in ACE_UDF.CH. You may think that since this library is written entirely in Xbase++, that it's performance would not be as good when compared to the ADSDBE which is written in C++. However you will be happy to know that this is not the case, in reality the ACE Wrappers are just as fast and in some cases even faster, than Alaska's ADSDBE. No additional DBE's are needed when using the ACE Wrappers, but to make it all work you will need to do the following:

    1. Include ACE_UDF.CH in all of your PRGs.
    2. Modify ACE_UDF.CH by adding all literal alias names used in your PRGs (see notes in file for more info).
    3. Include ACEXPP.LIB in your XPJ project file.
    4. Make sure that you have ACEXPP.DLL, ACE32.DLL, AXCWS32.DLL and ADSLOC32.DLL in the path.
    5. By default, ACEXPP.DLL is created with SQL replication enabled. If you don't need this feature, remove the "_ENABLE_SQL_REPLICATION" define statement from MAKEDLL.BAT and run the batch file to rebuild the DLL.
    6. Read additional notes included in ACE_UDF.CH, ACETEST.PRG and ACEADT.PRG prior to using the ACE Wrappers in your programs!

    To see how the translation works, compile your PRG with the /P parameter and look at the generated .PPO file, example:

      xpp test.prg /p

    SQL Replication:
    One of the most exciting features of the ACE Wrappers is seamless SQL replication of data using SQLExpress. With just one simple function call at the start of your program, The ACE Wrappers will automatically replicate DBF/ADT changes into an external SQL/ODBC data source. Data replication can be used to present a real-time, external view of your DBF/ADT data for reporting and querying purposes. To see how this magic feat is accomplished, search ACE.PRG for the keyword "_ENABLE_SQL_REPLICATION". To start using SQL replication, do the following:

    1. Create a DBESYS procedure in your application to define the ODBC connection string and the list of DBF/ADT tables to be replicated:
      PROCEDURE DbeSys()
         AceSetTableType("DBFCDX")   // set the default table type to be ADS_CDX
      
         // define ODBC connection to replicated database:
         AceSQLReplicateConnection('DRIVER=SQL Server;SERVER=DWS-01;UID=Xpp;PWD=Clipper;DATABASE=DataMart2')
      
         // define ADT or DBF tables that will be replicated:
         AceSQLReplicate('CUSTOMER')
         AceSQLReplicate('SUPPLIER')
         AceSQLReplicate('ORDERS')
      
         RETURN
         
    2. Define your list of replicated tables in SQLSYNC.PRG:
      #define _TABLES_TO_REPLICATE  {'CUSTOMER', 'SUPPLIER', 'ORDERS'}
      
    3. Compile and run SQLSYNC to create a copy of your current DBF/ADT tables.

    4. You are now ready to run your app. All changes to replicated tables will be automatically duplicated to external ODBC data source. If the tables for some reason go out of sync, all you need to do is run SQLSYNC.


    home     download     top of page