Group:  Microsoft Access ยป microsoft.public.access.externaldata
Thread: TransferDatabase to an EXISTING table

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

TransferDatabase to an EXISTING table
MarieT 27.09.2006 17:54:02
I need to import tables from another MS Access DB to tables with the same
names in my local MS Access DB, and then alter some of the field sizes in my
local tables. Since TransferDatabase appears to import only to a NEW table, I
wrote code to delete the existing local tables first, then import the tables
with TransferDatabase, and then alter the field sizes. This works fine as
long as the local tables exist before I delete them. Once in a while, one or
more of the tables do not get re-created for one reason or another, and when
the user runs the program, an error that "Access can't find the Object
'TableName'" is generated and the program halts. I then have to manually
re-create the table(s) and re-run the program.
Is there a way to make TransferDatabase import to an existing table
(over-writing it)?
Or is there a way I can check if a table exists before I attempt to delete it?
Any help would be greatly appreciated!
Mariet
RE: TransferDatabase to an EXISTING table
Klatuu 27.09.2006 19:34:02
Are you doing this using VBA or in a Macro?

"MarieT" wrote:

[Quoted Text]
> I need to import tables from another MS Access DB to tables with the same
> names in my local MS Access DB, and then alter some of the field sizes in my
> local tables. Since TransferDatabase appears to import only to a NEW table, I
> wrote code to delete the existing local tables first, then import the tables
> with TransferDatabase, and then alter the field sizes. This works fine as
> long as the local tables exist before I delete them. Once in a while, one or
> more of the tables do not get re-created for one reason or another, and when
> the user runs the program, an error that "Access can't find the Object
> 'TableName'" is generated and the program halts. I then have to manually
> re-create the table(s) and re-run the program.
> Is there a way to make TransferDatabase import to an existing table
> (over-writing it)?
> Or is there a way I can check if a table exists before I attempt to delete it?
> Any help would be greatly appreciated!
> Mariet

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net