copy data from database

martipao

New member
Joined
Jun 5, 2025
Messages
3
Programming Experience
3-5
I am working with Visual Studio 2019 in Visual Basic.

I have two databases (Access 2000 format) and need to copy values for some table from Db2 to Db1 . The issue is that tables in Db1 do not have same fields as tables in Db2.

eg.
Db1 table1 (field1, field2, field3)
Db2 table1 (field1, field2)

when copying the field 'field3' in Db2 should stay empty

anyone can help ?

Thanks
 
You can just ignore the field3 column. If you insert a record and don't refer to that column in the INSERT statement, it will remain NULL, just as you want.
 
You can just ignore the field3 column. If you insert a record and don't refer to that column in the INSERT statement, it will remain NULL, just as you want.
Thanks for your quick reply.

Yes, but in this case I need to know all fields of the table from both Dbs ... this operation iterates over 15 tables ...

The operation is part of the update process for an application and new versions may have a modified database ...
 
in this case I need to know all fields of the table from both Dbs

I don't know what that means. Please provide a FULL and CLEAR explanation of the problem.
 
The operation is part of the update process for an application and new versions may have a modified database ...

If that's the case then it sounds like you should be executing SQL code against the existing database to modify the schema as required, not copying data from an existing database to a new one.
 
I don't know what that means. Please provide a FULL and CLEAR explanation of the problem.

I am working on a Windows Form Application to manage product selection. I have delivered a first version of the tool one year ago and now I am ready (almost) to deliver a new version.

The issue is that the new version has new fields for some table. There is a procedure in the tool to update database with the new one, but it preserve operation registered.

So for those tables I need to add new fields and set them to NULL, EMPTY, 0 ...

I hope I have clarified my problem.
 
Back
Top