By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,156 Members | 1,071 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,156 IT Pros & Developers. It's quick & easy.

Merging Two Access DATABASES

P: 6
Hi All,

Just joined this site....I am really stuck into one problem. Actually I am writing a code in VB6 to merge TWO ACCESS DATABASES. Wanted to know if I can use a single sql query to merge. Is MERGE or UNION effective in merging two DATABASES. Plz help.
I am looking forward to get some positive replies.
Thanx in advance.

Gaurav
Jan 7 '08 #1
Share this Question
Share on Google+
6 Replies


P: 6
and yeah I forget to mention that structures are same.

Gaurav
Jan 7 '08 #2

vksingh24
P: 21
and yeah I forget to mention that structures are same.

Gaurav
No sure what you want. But it seems that you have two Access database and you want to access data of both databases.

You can create a Link Objects (Table /Query) of Database A, into Database B and Query them.
Jan 7 '08 #3

P: 6
No sure what you want. But it seems that you have two Access database and you want to access data of both databases.

You can create a Link Objects (Table /Query) of Database A, into Database B and Query them.

Hi vksingh

In simple words...I want to combine to identical Access databases into one and that to from vb6. Just need a hint to get started....can I do this by using adodc? or should I have to use some database object like
"dim db1 as database"
but I don't know how to manipulate this object? Jz need a little help.

Gaurav
Jan 7 '08 #4

jaxjagfan
Expert 100+
P: 254
Hi All,

Just joined this site....I am really stuck into one problem. Actually I am writing a code in VB6 to merge TWO ACCESS DATABASES. Wanted to know if I can use a single sql query to merge. Is MERGE or UNION effective in merging two DATABASES. Plz help.
I am looking forward to get some positive replies.
Thanx in advance.

Gaurav
If the 2 have identical field types then union will work. Just make a UNION query.

Select TableA.* From TableA;
UNION
Select TableB.* From TableB;

You will end up with the column names from TableA as column names.

I am unsure of the VB syntax it differs a little with VBA. It depends on the display method (Form, datagrid, report, etc)
Jan 7 '08 #5

FishVal
Expert 2.5K+
P: 2,653
Hi All,

Just joined this site....I am really stuck into one problem. Actually I am writing a code in VB6 to merge TWO ACCESS DATABASES. Wanted to know if I can use a single sql query to merge. Is MERGE or UNION effective in merging two DATABASES. Plz help.
I am looking forward to get some positive replies.
Thanx in advance.

Gaurav
Hi, gaubun.

Do you want to work with both as a single one or do you want work with each?
If you are mentioning the first, then I would like to stay that it is generally a bad practice.
  • all datasets obtained with UNION operation will be read-only
  • to tell nothing about indexed fields duplicating
  • etc

Is that an option to import all info from one db to another and work with the latter only? Or from some special reasons you want to stay with this configuration?

Regards,
Fish

P.S. Or you just want to retrieve only some special information?
Jan 7 '08 #6

P: 6
Hi, gaubun.

Do you want to work with both as a single one or do you want work with each?
If you are mentioning the first, then I would like to stay that it is generally a bad practice.


Hi Fish,

Thanx for your concern.
"Do you want to work with both as a single one or do you want work with each?
If you are mentioning the first, then I would like to stay that it is generally a bad practice."


Actually I am merging some village databases to its upper level i.e Subcenters or SCs database and then will use latter to generate reports. I am not going to manipulate ANY OF THE VILLAGE DATABASES. SC database is a temporary one...used only for report generations.
Suppose if I have two village databases (A and B) and one EMPTY DATABASE WITH SAME STRUCTURE (i.e C)
Now what I want is.......
C=A+B :-D

Now my problem is how can do this through Programming if Im using vb6 as frontend.

Currently I am connecting through Adodc but my knowledge is limited to
adodc1.recordsource="select......."
adodc1.refersh
adodc1.recordset.....blah blah blah

So how can I truncate/delete SC database and merge village database into it.

I tried to make it very clear.... plz help.
Jan 9 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.