I have created 3 sample programs for using ADS SQL with eXpress++.
There were a few mods required to _DCADS.PRG to improve some functionality.
1. Delete all the files and subfolders in your \exp20\samples\adssql folder.
2. Unzip the attached file to your \exp20\samples\adssql folder.
3. Move the _DCADS.PRG file to your \exp20\source\dclipx folder.
4. Rebuild DCLIPX.DLL by running BUILD20.BAT or BUILD19_SL1.BAT.
SQLTEST1.PRG :
This sample program shows how to use the SQL command in DCADS.CH.
This will build 3 different browses:
1. A SQL cursor in a work area.
2. The SQL cursor converted to a multidimensional array.
3. The SQL cursor converted to a single dimensional array of record objects.
The SQL command pre-processes to the function DC_AdsSQLStatement().
In this sample, a DacSession() must first be created to connect to Advantage Server.
This is done in procedure DbeSys(). In this example a connection is made to
a data dictionary named ./files/data/samples.add.
If the session object is not passed then DacSession():getDefault() is used.
SQLTEST2.PRG:
This sample program shows how to use the DC_ExecuteSQL() function to create a new
database from an SQL query using the INTO clause.
DC_ExecuteSQL() does not use the ADSDBE or DacSession(). Instead it makes ADS API
calls that are in ACE32.DLL by using the ADS wrapper functions in _DCADS.PRG.
Any ADS SQL statement that does not require a cursor to be returned can be run
with this function.
SQLTEST3.PRG :
This sample program shows how to use the DC_AdsStatement() class to create a SQL browse
An SQL cursor will be created in a work area with the Alias of "BALANCES"
In this sample, a DacSession() must first be created to connect to Advantage Server.
This is done in procedure DbeSys()
In this example a connection is made to free tables in a subfolder named ./files/data.
ADS SQL Samples
ADS SQL Samples
- Attachments
-
- adssql.zip
- (350.07 KiB) Downloaded 1161 times
The eXpress train is coming - and it has more cars.