
Exporting selected records to new DB (access and VB3)
Quote:
> Hallo,
> Ive got an ACCESS-Database with active referential integrity rules.
> The task is it to select some records (dynaset) and create a new DB.
> First Problem:
> How Can I preserve the relations by Counter-fields if I can't
> update the Counter-field manually?
> (Field isn't filled with continous numbers)
If you use an append query within Access to copy records from one file to
another, the records in the new table will have the same keys as the
records in the old one.
Quote:
> Second problem:
> Which tables can be transferred (first and so on) without violating the
> integrity rules?
Wherever you have a one to many relationship defined, you need to transfer
the table on the "one" side first, and then transfer the table on the
"many" side.
Quote:
> Is it possible to delete all relations, indexes and counters and
> do this by ACCESS, controlled or invoked by VB?
> Do You know a better or simpler way to do this?
Just to clarify, here's how to do this from within VB:
1) Define your append queries in Access. Test them.
2) In VB, create a QueryDef object for each of the queries.
3) Execute the queries in the proper order: "one" side first, then "many"
side.
Hope this helps.
Bob Rossney