Strategy

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Iain
Posts: 2
Joined: Mon 15 Aug 2005 06:14

Strategy

Post by Iain » Mon 15 Aug 2005 06:18

I have an existing document management app (large) that uses MySql.

We are likely to get a client in the near future that would prefer to use MS Sql - in principle the conversion is straightforward - no stored procedures, just a need to swap the data access elements (most of which are in a DataModule). However I dont really want two separate apps - what strategy might I be able to use make the data provider a configuration option in a single application?

Paul
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Post by Paul » Mon 15 Aug 2005 11:58

Which components does the original application use? What database is used in the original application?
If you want to migrate from BDE to MyDAC you can use MyDAC Migration wizard, that helps you to make the main work and swaps BDE components to MyDAC.
If you want to start a new application and access to 2 different databases you can use MyDAC, SDAC, ODAC simultaneously in your project. They have common DAC layer with base classes. You can use DbxOda, DbxMda, DbxSda dbExpress drivers for this purpose too.
Last edited by Paul on Tue 16 Aug 2005 09:25, edited 1 time in total.

Iain
Posts: 2
Joined: Mon 15 Aug 2005 06:14

Post by Iain » Mon 15 Aug 2005 13:12

Currently MySql with MySqlDAC - transfer to MyDAC should be straightfwd (but I cant run the demo with MySQLDAC installed) - the question is how might I best run against either MySQL or MS SQL from the same app, according to user preference

Paul
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Post by Paul » Tue 16 Aug 2005 10:04

Please use compatible versions of MyDAC and SDAC. You can work with TMyQuery and TMSQuery using its base class TCustomDADataSet as described in the following code.

CustomDADataSet.SQL.Text := '...';
CustomDADataSet.Params[...]...;
CustomDADataSet.Open; //CustomDADataSet.Execute;
CustomDADataSet.FieldByName(....)....;

Of course there will be some code that is specific for each database. You can work with Session and SQL command components similarly.

Post Reply