Deleting Database Objects

G

Guest

Hi,

How do you enumerate all objects within a db using VBA?

I need to delete all objects from a Frontend DB and then re-link / import
all objects from the Backend DB. This is to ensure the Frontend DB is
up-to-date.

Is this possible?

Cheers,
Steve.
 
N

Nikos Yannacopoulos

Steve,

The standard practice for this is to replace the whole front end... after
all, in a standard FE/BE design the back end would host only the data
tables, not the other objects! Have a look at:

www.granite.ab.ca/access/autofe.htm

for automating the process (and thank Tony Toews for it).

HTH,
Nikos
 
G

Guest

The reason for deleting/re-linking is I want the Frontend to be 'dynamic'. I
have several uses for a Front/Backend configuration and want to apply the
same system to different processes.

I store the Backend DB name & version in a table in the front, when I change
a form/table/report in the backend and update the version number, the
frontend detects this then delete's all the non-system objects and re-imports
them.

Sorry, to go on there!

So, is it possible to delete all the objects?

Thanks in anticipation,
Steve.
 
A

Alex Dybenko

you can use a following code

Dim i As Long
Dim dbs As Database

Set dbs = CurrentDb
For i = dbs.TableDefs.Count - 1 To 0 Step -1
If dbs.TableDefs(i).Name Like "msys*" Then
'system table, do nothing
Else
DoCmd.DeleteObject acTable, dbs.TableDefs(i).Name
End If
Next i
 
G

Guest

Thanks for all the replies.

What I was after was a 'client' Frontend that can be applied to any backend
and process. I have created 2 systems that essential work the same way but
having to repeat updates on both DB's can get quite time consuming.

There is actually 3 frontends to the 1 backend, so was looking for a
frontend that is transferable/re-usable.

I now have a Frontend table with a reference for each frontend. There is a
table in the backend containing the obejects that relate back to the relative
frontend. When the frontend is opened, it links/imports the objects it needs!

I may not be very clear as to what I am typing, but i know what I mean :)

Cheers,
Steve.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top