Re: Confirming a table exists before deleting it
From: chris ciotti (chris.ciotti_at_gmail.com)
Date: 01/29/05
- Next message: at: "Application with code digitally signed in Access 2003 crashes Access 2000"
- Previous message: Nick Coe \(UK\): "Re: Confirming a table exists before deleting it"
- In reply to: Gene: "Confirming a table exists before deleting it"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 29 Jan 2005 11:26:22 -0500
On Sat, 29 Jan 2005 10:29:07 -0500, Gene wrote
(in article <7A221942-3CDD-450C-AFE3-05F023721A5C@microsoft.com>):
> I use a form to create a table called tblImport. If the table already
> exists
> (from previously running the form), I use the DoCmd.DeleteObject acTable to
> delete it. If the table does NOT already exist, I get an error message when
> the DoCmd is executed. Is there any command that can check if a table
> "exists", and then I can skip the delete if it does not.
Hi Gene -
Access keeps a hidden table of objects (it's one of the MSys* tables) which
you can query. I can't recall the name but if you unhide the system tables
(via Tools -> Options; this might vary by Access version) and have a look you
can wrap a call to DCount in a function. If it returns 1 then the table
exists. I've done this before and it worked but I don't have the code handy
and am relying on memory (which is fragile on Sat morning :-)
I don't know if this is better or worse than looping through the Tabledefs.
Good luck in any event.
--chris
- Next message: at: "Application with code digitally signed in Access 2003 crashes Access 2000"
- Previous message: Nick Coe \(UK\): "Re: Confirming a table exists before deleting it"
- In reply to: Gene: "Confirming a table exists before deleting it"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|