Strategy

Strategy

Postby 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?
Iain
 
Posts: 2
Joined: Mon 15 Aug 2005 06:14

Postby 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.
Paul
 
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Postby 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
Iain
 
Posts: 2
Joined: Mon 15 Aug 2005 06:14

Postby 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.
Paul
 
Posts: 725
Joined: Thu 28 Oct 2004 14:06


Return to MySQL Data Access Components