views:

55

answers:

1

I'm working on a legacy project, written for the most part in Delphi 5 before it was upgraded to Delphi 2007. A lot has changed after this upgrade, except the database that's underneath. It still uses MS-Access for data storage.

Now we want to support SQL Server as an alternate database. Still just for single-user situations, although multi-user support will be a feature for the future. And although there won't be many migration problems (see below) when it needs to use a different database, keeping two database structures synchronized is a bit of a problem.

If I would create an SQL script to generate the SQL Server database then I would need a second script to keep the Access database up-to-date too. They don't speak the same dialect. (At least, not for our purposes.) So I need a way to maintain the database structure in a simple way, making sure it can generate both a valid SQL Server database as an Access database. I could write my own tool where I store the database structure inside an XML file, which combined with some smart code and ADOX would generate both database types.

But isn't there already a good tool that can do this?


Note: the application also uses ADO and all queries are just simple select statements. Although it has 50+ tables, there's one root "Document" table and the user selects one of the "documents" in this table. It then collects all records from all tables that are related to this document record and stores them in an in-memory structure. When the user saves the data, it just writes the document record and all changed data back to the database again. Basically, this read/write mechanism of documents is the only database interaction in the whole application. So using a different database is not a big problem.

We will drop the MS-Access database in the future but for now we have 4000 customers using this application. We first need to make sure the whole thing works with SQL Server and we need to continue to maintain the current code. As a result, we will have to support both databases for at least a year.

+1  A: 

Take a look at the DB Explorer, there is a trial download too.

OR

  1. Use migration wizard from MS Access to SQL Server
  2. After development in Access (schema changes), use the wizard again.
  3. Use a tool to compare SQL Server schemata.
Damir Sudarevic
We actually want to avoid developers making changes in either Access or SQL Server. Past experiences have shown that this leads to many errors where we forget to synchronize changes.
Workshop Alex
In that case the db Explorer will do. It covers SQL server, Access and few more. It can compare and document schemata. Use MS migration wizard to convert to SQL server, docuent "reference versions" and just compare Access to Access and SQL Server to SQL server.
Damir Sudarevic