FMX.FireDAC.MongoDB.BatchMove Sample

From RAD Studio Code Examples
Jump to: navigation, search

This sample shows how to copy data from a SQLite dataset to a MongoDB dataset in Delphi and C++Builder applications.

Location

You can find the BatchMove sample project at:

  • Start | Programs | Embarcadero RAD Studio Sydney | Samples and navigate to:
    • Object Pascal\Database\FireDAC\Samples\DBMS Specific\MongoDB\BatchMove
    • CPP\Database\FireDAC\Samples\DBMS Specific\MongoDB\BatchMove
  • Subversion Repository:
    • You can find Delphi and C++ code samples in GitHub Repositories. Search by name into the samples repositories according to your RAD Studio version.

Description

This sample application illustrates how to work with SQLite and MongoDB databases.

Using this sample application, you can:

  • Connect to an SQLite database
  • Connect to a MongoDB server
  • Copy data records from the specified table in SQLite to a MongoDB database.

Preliminary Steps

Before using the BatchMove sample project, review the following checklist:

  • A MongoDB server is running and accessible from your host.

Note: If the MongoDB server is not running on the machine where you want to run this sample application, or requires non-default connection parameters, such as a port other than 27017, configure the FDConnection1 component accordingly. For details, see Connect to MongoDB Database.

How to Use the Sample

To run this project

  1. Navigate to one of the locations given above and open:
    • Delphi: Mongo_BatchMove.dproj project file.
    • C++Builder: Mongo_BatchMove.cbproj project file.
  2. Press F9 or choose Run > Run.
  3. Click the Move Data button.

BatchMove Demo.png

Files

File in Delphi File in C++ Contains

Mongo_BatchMove.dproj

Mongo_BatchMove.cbproj

The project itself.

fMain.fmx

fMain.fmx

The main form where the components are located.

fMain.pas

fmain.cpp

Implementation of the sample.

Implementation

Uses

See Also