1 (edited by pdtonks77 2021-02-24 19:43:45)

Topic: Import & export Database

Hi there,
is there any way to import & export the database.

1. i have created this database program for my dad so he can keep a record of all his ZX spectrum games
2. i then i created a new version with the option to record his Sam Coupe Games.

3. i need a search button on there aswell but cant get it working so took it off.

the problem is every time i create a new version he has to retype all the games in again
so is there any way i can get round this

i have attached the data base

Post's attachments

Attachment icon PDT Database V2-0.rar 348.28 kb, 276 downloads since 2021-02-24 

Re: Import & export Database

it depends on the complexity of the database structure.  If the new versions do not bring changes in the structure of the database, you can use the import of the software itself.

if it is the opposite, then you will have to implement the import yourself.  In the forum search type import export and several suggestions will appear.

Wen

3 (edited by ehwagner 2021-02-25 20:54:16)

Re: Import & export Database

You really do not need to do an import for a new version of the software. You can do what I do. If a new version of your software requires a change to the structure of your database, you can create a small program which all it does is alter the structure of your end user's database. For example:

SqlExecute('ALTER TABLE company ADD COLUMN coPhone TEXT');

You can also create tables and even populate new tables through this program. Then when it comes time to distribute to your users, you send them the new version of your main program and in addition send them the small database upgrade program. Have your end users run the database upgrade program first. All this program does is change in place their database structure for the new version of your program. No import is necessary. When they run their new version of the program it will be accessing the new version of the database that is already populated.


If you use an install software for your users, you can have this database upgrade program automatically run during the install of your new main program. The user does not even know that it happened.


Optionally there is a PRAGMA instruction to check for the database version prior to the update. So that if the database is not the correct version, then you can take the appropriate steps to either update it or present an error message and not do the update.

4 (edited by derek 2021-02-26 00:29:24)

Re: Import & export Database

As a VERY general rule of thumb, if all you are doing is adding fields to existing tables or adding tables that are unrelated to existing tables, then there is no reason why you can't continue with your existing database;  there is no need for data to be re-keyed / imported at all.
Of more concern is the approach that you have taken which will cause you problems as you continue to develop your project. 
Basically, you are duplicating existing tables and making them specific to each 'games maker' rather than simply adding a new table that holds the 'games maker' name and then relating it to a generic 'games' table. 
In addition, you are also duplicating forms and making them specific for each 'games maker' rather than using a common form.
I would advise you to have a look at the attachment as a suggestion for how you could structure your database more efficiently, reduce the number of forms you've created and use them effectively.
Derek.

Post's attachments

Attachment icon gamesG.zip 445.96 kb, 307 downloads since 2021-02-26