Learn How To Migrate dbExpress To FireDAC With The reFind Tool In This Delphi Sample
February 7, 2021 by Konstantin Tomov
This sample project demonstrates how to migrate the project MeetingOrganizer from dbExpress to FireDAC using the reFind.exe tool.
The migrate.bat utility creates a new subdirectory FireDAC_MeetingOrg under Forms, and copies the source files of your dbExpress application to the FireDAC_MeetingOrg folder. It keeps the original source files.
The utility runs the RAD Studio Для просмотра ссылки Войдиили Зарегистрируйся tool in order to Для просмотра ссылки Войди или Зарегистрируйся of the application with their FireDAC counterparts.
Example of reFind.exe usage:
You can find the “reFind.exe” utility in “C:\Program Files (x86)\EmbarcaderoStudio\21.0\bin\reFind.exe“.
To run Migrate.bat:
You can find the configuration file in C:\Users\Public\Documents\Embarcadero\Studio\FireDAC\FDConnectionDefs.ini
или Зарегистрируйся, comment the part that is pointing to the dbxconnections.ini file:
Для просмотра ссылки Войдиили Зарегистрируйся
Для просмотра ссылки Войдиили Зарегистрируйся
February 7, 2021 by Konstantin Tomov
This sample project demonstrates how to migrate the project MeetingOrganizer from dbExpress to FireDAC using the reFind.exe tool.
Location
You can find the DBX2FDMigration project at:- Start | Programs | Embarcadero RAD Studio Sydney | Samples and then navigate to:
- Object Pascal\Database\FireDAC\Tool\reFind\DBX2FDMigration\Demo\Forms
- Subversion Repository:
- You can find Delphi code samples in Для просмотра ссылки Войди
или Зарегистрируйся. Search by name into the samples repositories according to your RAD Studio version.
- You can find Delphi code samples in Для просмотра ссылки Войди
How to Use the Sample
To use this sample project- Run the migrate.bat utility.
- Create the new FireDAC connection definition.
- Add some additional components to your application form.
- Set up the FireDAC connection parameters.
- Run this demo application.
Run Migrate.bat Utility
The migrate.bat utility is located in the C:UsersPublicDocumentsEmbarcaderoStudio21.0SamplesObject PascalDatabaseFireDACToolreFindDBX2FDMigrationDemo folder.The migrate.bat utility creates a new subdirectory FireDAC_MeetingOrg under Forms, and copies the source files of your dbExpress application to the FireDAC_MeetingOrg folder. It keeps the original source files.
The utility runs the RAD Studio Для просмотра ссылки Войди
Example of reFind.exe usage:
Код:
reFind.exe FireDAC_MeetingOrg*.pas FireDAC_MeetingOrg*.dfm FireDAC_MeetingOrg*.fmx /X:....FireDAC_Migrate_DBX.txt
To run Migrate.bat:
- Go to C:UsersPublicDocumentsEmbarcaderoStudio21.0SamplesObject PascalDatabaseFireDACToolreFindDBX2FDMigrationDemo folder.
- Double-click the migration.bat application to start the migration process.
Creating the new FireDAC Connection Definition
- Open the project MeetingOrganizer.dproj located at C:UsersPublicDocumentsEmbarcaderoStudio21.0SamplesObject PascalDatabaseFireDACToolreFindDBX2FDMigrationDemoFormsFireDAC_MeetingOrg
- Create a FireDAC Для просмотра ссылки Войди
или Зарегистрируйся using the Для просмотра ссылки Войдиили Зарегистрируйся.- Go to Tools > FireDAC Explorer.SYSDBA
- In the FireDAC Explorer tool, go to File > New > Connection Definition.
- Setup the connection definition parameters.
Код:
[MO]
Database=C:\Users\Public\Documents\EmbarcaderoStudio\16.0\Samples\Object Pascal\Database\FireDAC\Tool\reFind\DBX2FDMigration\Demo\Database\MEETINGORGANIZER.GDB
User_Name=SYSDBA
Server=127.0.0.1
DriverID=IB
Password=masterkey
Adding some Components to Your Application Form
You need to add the following components to your application form:- A Для просмотра ссылки Войди
или Зарегистрируйся component. - A Для просмотра ссылки Войди
или Зарегистрируйся component.
Setting Up the FireDAC Connection Parameters
- In the Structure view, select FDConnection1.
- In the Для просмотра ссылки Войди
или Зарегистрируйся, specify the following parameters:- Fill the Для просмотра ссылки Войди
или Зарегистрируйся property with the name of the connection defined using the FireDAC Explorer. - Use the Для просмотра ссылки Войди
или Зарегистрируйся property to define the path to the database.
- Fill the Для просмотра ссылки Войди
Код:
procedure TMainDM.SQLConnectionBeforeConnect(Sender: TObject);
begin
// SQLConnection.LoadParamsFromIniFile
// (IncludeTrailingPathDelimiter(ExtractFilePath(Application.ExeName)) +
// 'dbxconnections.ini');
end;
Running This Demo Application
- Press F9 or choose Run > Run.
- When prompted, type in the User Login and the Password: borland, borland.
Для просмотра ссылки Войди
Для просмотра ссылки Войди