The SQL files contains "Create table" statements, "Alter table" statements, etc.
What's the best way to check whether the database was created out of
the file ??
I want to do this programmatically.
Which is easier ?
(i) to change the database to a file of SQL statements and then compare the 2 files, OR
(ii) to change the file into a database and then compare the 2 databases
(iii) OR other methods ...
1) Put all SQL into a directory
2) Create a blank database
3) Write some code in VBA:
a) Use the Dir() array to loop through, using docmd.runsql for create and alter & saving the others as querydefs
b) You now have a database
c) It's then pretty easy to run through the objects you have & check,either visually or in code.
If you're going down the programming route there's probably not much to choose time-wise between the two methods. However this way you can then verify the end result more easily - I always like to be able to check the results!
It's also simpler as reverse engineering the tables into queries would involve a lot of looping through recordsets to get all of the field headings. The only proviso is if there's some simple Access functionality I haven't come across... mind you that wouldn't surprise me given the onion nature of the application!