MyDAC includes a number of demo projects that show off the main MyDAC functionality and development patterns.
The MyDAC demo projects consist of one large project called MyDacDemo with demos for all main MyDAC components, use cases, and data access technologies, and a number of smaller projects on how to use MyDAC in different IDEs and how to integrate MyDAC with third-party components.
Most demo projects are built for Delphi and Borland Developer Studio. There are only two MyDAC demos for C++Builder. However, the C++Builder distribution includes source code for all the other demo projects as well.
In most cases all the MyDAC demo projects are located in "%MyDac%\Demos\".
In Delphi 2007 for Win32 under Windows Vista all the MyDAC demo projects are located in "My Documents\Devart\MyDac for Delphi 2007\Demos", for example "C:\Documents and Settings\All Users\Documents\Devart\MyDac for Delphi 2007\Demos\".
The structure of the demo project directory depends on the IDE version you are using.
For most new IDEs the structure will be as follows.
|—MyDacDemo [The main MyDAC demo project]
| |— Embedded [Win32 version of the Embedded MySQL server using demo]
| |— SecureBridge [A component and a demo for integration with the SecureBridge library]
| |— [A collection of demo projects on integration with third-party components]
|— [Some other demo projects on design technologies]
MyDacDemo is the main demo project that shows off all the MyDAC functionality. The other directories contain a number of supplementary demo projects that describe special use cases. A list of all the samples in the MyDAC demo project and a description for the supplementary projects is provided in the following section.
Note: This documentation describes ALL the MyDAC demo projects. The actual demo projects you will have installed on your computer depends on your MyDAC version, MyDAC edition, and the IDE version you are using. The integration demos may require installation of third-party components to compile and work properly.
To explore a MyDAC demo project,
The included sample applications are fully functional. To use the demos, you have to first set up a connection to MySQL. You can do so by clicking on the "Connect" button.
Many demos may also use some database objects. If so, they will have two object manipulation buttons, "Create" and "Drop". If your demo requires additional objects, click "Create" to create the necessary database objects. When you are done with a demo, click "Drop" to remove all the objects used for the demo from your database.
Note: The MyDAC demo directory includes two sample SQL scripts for creating and dropping all the test schema objects used in the MyDAC demos. You can modify and execute this script manually, if you would like. This will not change the behavior of the demos.
You can find a complete walkthrough for the main MyDAC demo project in the Getting Started topic. The other MyDAC demo projects include a ReadMe.txt file with individual building and launching instructions.
MyDacDemo is one large project which includes three collections of demos.
Working with components
A collection of samples that show how to work with the basic MyDAC components.
A collection of samples that show off the MyDAC technology and demonstrate some ways to work with data.
A collection of samples that demonstrate how to incorporate MySQL features in database applications.
MyDacDemo can be opened from %MyDac%\Demos\MyDacDemo\MyDacDemo.dpr (.bdsproj). The following table describes all demos contained in this project.
|Command||Uses TMyCommand to execute SQL statements. Demonstrates how to execute commands in a separate thread, and how to break long-duration query execution.|
|ConnectDialog||Demonstrates how to customize the MyDAC connect dialog. Changes the standard MyDAC connect dialog to two custom connect dialogs. The first customized sample dialog is inherited from the TForm class, and the second one is inherited from the default MyDAC connect dialog class.|
|CRDBGrid||Demonstrates how to work with the TCRDBGrid component. Shows off the main TCRDBGrid features, like filtering, searching, stretching, using compound headers, and more.|
|Loader||Uses the TMyLoader component to quickly load data into a server table. TMyLoader loads data by grouping several data rows into a single INSERT statement and executing this statement. This way is much faster then execuing one INSERT statement per row. This demo also compares the two TMyLoader data loading handlers: GetColumnData and PutData.|
|Query||Demonstrates working with TMyQuery, which is one of the most useful MyDAC components. Includes many TMyQuery usage scenarios. Demonstrates how to edit data and export it to XML files.
Note: This is a very good introductory demo. We recommend starting here when first becoming familiar with MyDAC.
|StoredProc||Uses TMyStoredProc to access an editable recordset from an MySQL stored procedure in the client application.|
|Table||Demonstrates how to use TMyTable to work with data from a single table on the server without writing any SQL queries manually. Performs server-side data sorting and filtering and retrieves results for browsing and editing.|
|UpdateSQL||Demonstrates using the TMyUpdateSQL component to customize update commands. Lets you optionally use TMyCommand and TMyQuery objects for carrying out insert, delete, query, and update commands.|
|VirtualTable||Demonstrates working with the TVirtualTable component. This sample shows how to fill virtual dataset with data from other datasets, filter data by a given criteria, locate specified records, perform file operations, and change data and table structure.|
|CachedUpdates||Demonstrates how to perform the most important tasks of working with data in CachedUpdates mode, including highlighting uncommitted changes, managing transactions, and committing changes in a batch.|
|FilterAndIndex||Demonstrates MyDAC's local storage functionality. This sample shows how to perform local filtering, sorting and locating by multiple fields, including by calculated and lookup fields.|
|MasterDetail||Uses MyDAC functionality to work with master/detail relationships. This sample shows how to use local master/detail functionality. Demonstrates different kinds of master/detail linking, including linking by SQL, by simple fields, and by calculated fields.|
|Pictures||Uses MyDAC functionality to work with BLOB fields and graphics. The sample demonstrates how to retrieve binary data from MySQL database and display it on visual components. The sample also shows how to load and save pictures to files and to the database.|
|Text||Uses MyDAC functionality to work with text. The sample demonstrates how to retrieve text data from MySQL database and display it on visual components. The sample also shows how to load and save text to files and to the database.|
|Transactions||Demonstrates the recommended approach for managing transactions with the TMyConnection component. The TMyConnection interface provides a wrapper for MySQL server commands like START TRANSACTION, COMMIT, ROLLBACK.|
|Lock||Demonstrates two kinds of row-level locking (immediate locking and delayed locking) with the InnoDB storage engine. This functionality is based on the following MySQL commands: SELECT ... FOR UPDATE and SELECT ... LOCK IN SHARE MODE.|
MyDAC also includes a number of additional demo projects that describe some special use cases, show how to use MyDAC in different IDEs and give examples of how to integrate it with third-party components. These supplementary MyDAC demo projects are sorted into subfolders in the %MyDac%\Demos\ directory.
|ThirdParty||FastReport||Demonstrates how MyDAC can be used with FastReport components. This project consists of two parts. The first part is several packages that integrate MyDAC components into the FastReport editor. The second part is a demo application that lets you design and preview reports with MyDAC technology in the FastReport editor.|
|InfoPower||Uses InfoPower components to display recordsets retrieved with MyDAC. This demo project displays an InfoPower grid component and fills it with the result of an MyDAC query. Shows how to link MyDAC data sources to InfoPower components.|
|IntraWeb||A collection of sample projects that show how to use MyDAC components as data sources for IntraWeb applications. Contains IntraWeb samples for setting up a connection, querying a database and modifying data and working with CachedUpdates and MasterDetail relationships.|
|QuickReport||Lets you launch and view a QuickReport application based on MyDAC. This demo project lets you modify the application in design-time.|
|ReportBuilder||Uses MyDAC data sources to create a ReportBuilder report that takes data from MySQL database. Shows how to set up a ReportBuilder document in design-time and how to integrate MyDAC components into the Report Builder editor to perform document design in run-time.|
|TechnologySpecific||Embedded||Demonstrates working with Embedded MySQL server by using the TMyEmbConnection component. This demo creates a database structure, if it does not already exist, opens a table from this database. Also this demo shows how to process the log messages of the Embedded server.|
|SecureBridge||The demo project demonstrates how to integrate the SecureBridge components with MyDAC to ensure secure connection to MySQL server through an SSH tunnel and SSL.
This demo consists of three parts. The first part is a package that contains TMySSHIOHandler and TMySSLIOHandler component. These components provide integration with the SecureBridge library. The second part is two sample projects that demonstrate how to connect to MySQL server through an SSH server and through SSL, connect to the SSH server with SecureBridge by password or by public key, generate reliable random numbers, enable local port forwarding.
For more information see the Readme.html file in the demo directory.
|Miscellaneous||CBuilder||A general demo project about how to create MyDAC-based applications with C++Builder. Lets you execute SQL scripts and work with result sets in a grid. This is one of the two MyDAC demos for C++Builder.|
|Dll||Demonstrates creating and loading DLLs for MyDAC-based projects. This demo project consists of two parts - an My_Dll project that creates a DLL of a form that sends a query to the server and displays its results, and an My_Exe project that can be executed to display a form for loading and running this DLL. Allows you to build a dll for one MyDAC-based project and load and test it from a separate application.|
|FailOver||Demonstrates the recommended approach to working with unstable networks. This sample lets you perform transactions and updates in several different modes, simulate a sudden session termination, and view what happens to your data state when connections to the server are unexpectedly lost. Shows off CachedUpdates, LocalMasterDetail, FetchAll, Pooling, and different Failover modes.|
|Midas||Demonstrates using MIDAS technology with MyDAC. This project consists of two parts: a MIDAS server that processes requests to the database and a thin MIDAS client that displays an interactive grid. This demo shows how to build thin clients that display interactive components and delegate all database interaction to a server application for processing.|
|VirtualTableCB||Demonstrates working with the TVirtualTable component. This sample shows how to fill virtual dataset with data from other datasets, filter data by a given criteria, locate specified records, perform file operations, and change data and table structure. This is one of the two demo projects for C++Builder|
|MyDacDemo||MyDacDemo||[Win32 version of the main MyDAC demo project - see above]|