As of today, Delphi’s latest edition 10.1 Berlin is not supported by SAP’s Advantage Database Server Delphi Client (V12). But there are a lot of ADS developers out there who want to use the latest version. As in the past, it’s quite easy to get the components available – Dr. Bob published an article a couple of years back on how to get it done in Delphi XE2: http://www.drbob42.com/examines/examine1.htm. Let’s use that article as the receipt.
Getting the source code
If you’ve installed the ADS Delphi components with an earlier version of Delphi, you do have the component’s sources available in program files(x86)\Advantage 12.0\TDataset. For all of those who don’t have the sources, there’s an easy way to get them. Download the trial version of ADS (32Bit edition) and extract the installers. Then clean your TEMP folder (%temp%) and launch the adsdelphi.exe installer. Click through the license agreement until the install process starts and prompts you with the Welcome screen.
Now open Windows explorer and navigate to your temp directory. You should see a newly created folder that contains the MSI package file. Copy all of these files to a separate location and cancel the installer.
Open a command prompt and navigate to your copy of the MSI package. Launch following command line
msiexec /a "Advantage Delphi Components v12.0.msi" /qb TARGETDIR=C:\adsdelphi\files
During the installaion process you’ll get some errors about missing collation files, but that doesn’t matter. After the installation is finished, all required files can be found in C:\adsdelphi\files.
Now edit c:\adsdelphi\files\System32\adslocal.cfg and adjust your settings (e.g. ANSI_CHAR_SET and OEM_CHAR_SET to match your collation). After saving the config file, delete all BPI and BPL files – you don’t need them. Then copy the content of the System32 folder to Windows\System32 (on Win32 systems) or Windows\SysWOW64 (on Win64 systems).
Finally, copy the content of c:\adsdelphi\files\program files to your program files(x86).
Get your packages
In program files(x86)\Advantage 12.0\TDataset make a copy of the latest supported Delphi version and rename it to Delphi101Berlin. In the Delphi101Berlin folder, locate all copies of the versions.inc file (Win32, Win32\source, Win64, Win64\source) and replace them with this versions.inc (you need to remove the .txt extension).
Launch Delphi Berlin as Administrator, open the runtime project Win32\sources\adsdxe8studio.dproj and save the project as adsd101berlinstudio.dproj to the same location. Modify the DCP output directory to the local folder (.\).Then build the project. Now open the design time project adsdxe8dstudio.dproj and save it as adsd101berlindstudio.dproj. Modify the requires section so it points to your newly built adsd101berlinstudio.dcp instead of adsdxe8studio.dcp. Finally built and install the projekt.
Let’s close Delphi/RadStudio and launch it without adminstrative permissions. Create a new VCL project, add TAdsConnection, TAdsQuery, TDataSource, TDBGrid, and a TDBNavigator component. In your AdsConnection properties, set AdsServerTypes to stADS_LOCAL and ConnectPath to any location on your PC. Then set your AdsQuery’s AdsConnection property to your AdsConnection, RequestLive to True and click on the ellipsis (…) of the SQL property. This should open a SQL utility to edit and test SQL statements (that utility is launched from the AdsAdditionalDesigners.dll we’ve copied earlier from System32). Enter any valid SQL statement or SQL script and press the green play button.
Click OK to close the utility. Then set your DataSource’s DataSet property to the AdsQuery, and the DBGrid’s and DBNavigator’s DataSource to your DataSource.
In FormCreate, connect your Database and open the Query:
procedure TForm1.FormCreate(Sender: TObject); begin AdsConnection1.Connect; AdsQuery1.Open; end;
Now compile and launch the project. If it launches without error messages, all went well and you can use ADS with Berlin.