Page 1 of 1
Strategy
Posted: Mon 15 Aug 2005 06:18
by Iain
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?
Posted: Mon 15 Aug 2005 11:58
by Paul
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.
Posted: Mon 15 Aug 2005 13:12
by Iain
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
Posted: Tue 16 Aug 2005 10:04
by Paul
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.