Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB 6
|
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 14th, 2005, 08:45 AM
Registered User
 
Join Date: Nov 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Trying to upgrade customers' database

Hi all,

I am using Visual Basic 6 stand alone application with Access (2k to 2003) database. Now I have changed a lot of stuffs, for example, adding, renaming and removing tables and fields, and adding queries, in the database. Then I have to upgrading my customers' database, too. However, they are not willing to give me their copy of databases because of their private data. So I need to write a VB program to automatically upgrade their databases on their side and keep all their existing data.

Sounds complicated, doesn't it? Any recommandations about the best ways to do it? Besides, how can I verify if a data field already exists in a table?

Appreciate for replying soon.
 
Old June 14th, 2005, 08:53 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there..

you can do all that kind of things using sql.. you can use
Code:
 CREATE
to make a new table, add or drop to add or remove rows...

and to verify if a field exists you can do a query to retrieve that field ;) and if you have an error that field no exists...

HTH

Gonzalo
 
Old June 15th, 2005, 01:49 PM
Authorized User
 
Join Date: May 2004
Posts: 83
Thanks: 0
Thanked 1 Time in 1 Post
Default

To do that you can take one of two appoaches depending on whether you can copy data from an old table, say my_old_table, to the corresponding new table, say my_new_table, using a simple SELECT statement.

If you can do so, your best bet is to write CREATE TABLE statements and execute them against your customer's database so that it contains the old tables + data in them + new tables. Now simply execute SELECT statements to bulk-copy data from the old tables to the new ones.

If you cannot do so, however, the method I just described is not the way to go. In this case, you should create a separate database with the new structure. Then write a VB program that processes each table sequentially and dumps data from the old database to the new one. If you do take this approach, be sure to take care of any constraints. For example, you'll have to copy data to a parent table before you can copy data to a child table, a table whose records reference records in the master table. After data is copied to the new database, delete the old database.

In either case, be sure to have your database backed up, just to be on the safe side.

I hope this helps.

Regards,

ejan





Similar Threads
Thread Thread Starter Forum Replies Last Post
customers table missing harvtim BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 September 25th, 2007 03:17 AM
Upgrade from ASP 1.1 to 2.0 Gaurav Sinha ASP.NET 2.0 Basics 0 February 18th, 2007 11:52 PM
When to Upgrade to Oracle! timoma Oracle 2 June 20th, 2005 08:42 AM
How to upgrade .netFrameWork doctorsom General .NET 0 February 1st, 2005 08:31 AM
prevent duplicate customers when importing data stoneman Access 1 August 6th, 2004 10:31 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.