Delete Table in BE Database

  • Thread starter Thread starter Anand
  • Start date Start date
A

Anand

I bet Ive read about this a while ago but I cant seem to
find the thread anymore.

Q is how do I delete a table sitting in a back end
database file with code in the FE. Ive figured out how to
create the temp table but cant seem to get the deleting
part.

Thanks for the help
A
 
Have the solution...You do NOT have any problem Linking to
that Table in the BE, do you?

HTH - Bob
 
Why are you creating the Temp table in the backend? You will get better performance if
this is done in the front-end. Also, with multiple users, the backend can be hard to
compact (you have to get everyone out of it), but you can compact the front-end when you
want (only the one user if you have a copy of the front-end on each workstation). Adding
and deleting the temp table will create a lot of bloat. Also, what if more than one user
attempts to create this temp table in the backend? If it's in the front-end you don't have
to worry about them overwriting each other or blocking each other. Also, do you need to
create and delete the table or just delete the data from the temp table when you're done
and leave the table for next time?
 
Not sure which method you are using, but I'm going to assume it's DAO

<DatabaseObject>.TableDefs.Delete <NameOfTable>

Notes

<DatabaseObject> is the object variable used for your database

<NameOfTable> is the name of the table in the <DatabaseObject>, which is a
member of the TableDefs Collection. <NameOfTable> is in String data type.

Help page initially started from is titled, "TableDefs Collection (DAO)"
Click on Methods
Click on Delete
 
Added to Wayne's note about this issue of creating temp tables, if it's
anywhere you should create temp tables, it should be in the front end DB.
Not only cause of the compacting and bloating issues that has already been
pointed out, but if for whatever reason something was to happen to the
server that the BE DB file(s) is/are located on, your temp tables in the FE
could serve as a temporary backup for so much time depending on the nature
of your business/industry. However, when creating temp tables in the FE for
this purpose, care must be taken cause I remind you, your FE DB file is
still limited to the 2GB max amount of memory allowed for any one DB file.
Not only do you have to think about the 2GB max allowed within any Access DB
file, but also think about the amount of HD space that's available, and if
even any one system has an HD space of only a few hundred MBs of free disk
space, you are more than likely going to run into issues. Therefore,
something like this must be carefully planned out before any sort of
development takes place in this area.
 
Back
Top