Creating script to update DB from VB

databases United Kingdom
  • 19 years ago

    I have developed a VB6 application which uses ADO2.5 to access a Access2000 DB. Now I am in phase 2 of the project where tables have been added to the database and columns added to existing tables. I need to write a procedure that can be run from the application that converts any old databasefiles the users must have into the latest version. I.e. automatically adds columns, tables and view to the user's database to make it compatible with my updated application. How do I do this ?
    An alternative is to write a routine that imports all data from an old database into the a database created with the new format. Anybody got some good ideas?

  • 19 years ago

    Just generate some SQL statements, and then execute them. For example, to add a new column, use
    ALTER TABLE thetablename
      ADD thefield thedatatype

  • 19 years ago

    You could also use ADOX.  MDAC 2.5 comes with it, so you already have it available.

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“God could create the world in six days because he didn't have to make it compatible with the previous version.”