Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2003
    Location
    Australia
    Posts
    217

    Unhappy Unanswered: HELP ! Database matches SQL ?

    I got a database and a file of SQL statements.

    The database is an MS Access database.

    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 ...



    Last edited by Lepanto; 07-28-03 at 06:08.

  2. #2
    Join Date
    Jul 2003
    Location
    London UK
    Posts
    14
    Import the SQL to a copy and run it.

  3. #3
    Join Date
    Jul 2003
    Location
    Australia
    Posts
    217
    Are you sure that's quicker ?

  4. #4
    Join Date
    Jul 2003
    Location
    London UK
    Posts
    14
    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.

  5. #5
    Join Date
    Jul 2003
    Location
    Australia
    Posts
    217
    So you are saying (ii) is better :

    "to change the file into a database and then compare the 2 databases"

    Isn't it ??

  6. #6
    Join Date
    Jul 2003
    Location
    London UK
    Posts
    14
    Yes...
    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •