473,387 Members | 1,561 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to delete database objects programmatically

I would like to know how to delete one or more database objects
programmatically.
For example, delete all forms, or all reports, ...etc.

I'm using Access 2003

Thanks,

Mourad
Aug 13 '08 #1
2 9522
JvC
DoCmd.DeleteObject ObjectType, ObjectName

Check the help file for more detail

John

Mourad wrote on 8/13/2008 :
I would like to know how to delete one or more database objects
programmatically.
For example, delete all forms, or all reports, ...etc.

I'm using Access 2003

Thanks,

Mourad

Aug 13 '08 #2
On Wed, 13 Aug 2008 09:24:20 -0700 (PDT), Mourad wrote:
I would like to know how to delete one or more database objects
programmatically.
For example, delete all forms, or all reports, ...etc.

I'm using Access 2003

Thanks,

Mourad
I'm sure you can figure out how to delete all Reports from this:

Dim doc As Document
Dim cont As Container
For Each cont In CurrentDb.Containers
If cont.Name = "Forms" Then
For Each doc In cont.Documents
DoCmd.DeleteObject acForm, doc.Name
Next doc
End If
Next cont

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Aug 13 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: tbone | last post by:
We were using sql authentication on our sql server 2000 servers, But need to use windows authentication. I have an sql user jdoe that owns many different objects in multiple databases. I have...
16
by: robert | last post by:
been ruminating on the question (mostly in a 390/v7 context) of whether, and if so when, a row update becomes an insert/delete. i assume that there is a threshold on the number of columns of the...
4
by: Shyguy | last post by:
I have a database that backs up critical tables to a database, named Backup with the date, daily. I can't figure out how to delete these databases programmatically, say when they are 5 days old or...
3
by: Ellen Manning | last post by:
Using A2K. I need syntax to delete all objects from a database other than tables, like with a FOR...LOOP construct. I researched the newsgroup and found suggestions to look thru Access help on...
3
by: Bob Darlington | last post by:
Using Access 2002. I have imported one form and two modules from another database, in order to compare code. Having finished the comparison, I cannot delete them. When I press 'Delete', I get a...
5
by: wo20051223 | last post by:
Deleting some files with C# fails with "Access to the path 'X' is denied". I have files copied from a CD that I burned (and not locked by a process) and a text file that I created in Windows...
6
by: polocar | last post by:
Hi, I'm writing a program in Visual C# 2005 Professional Edition. This program connects to a SQL Server 2005 database called "Generations" (in which there is only one table, called...
4
by: itrahulsoni | last post by:
hi all, I want to delete the cookies that are set by the google personalize home page or when once i view the you tube video cookie is set I want it to delete programmatically so I am able to see...
6
by: Annalyzer | last post by:
My database must produces a .csv file with a header line that is different from the detail lines. This .csv file contains a monthly report to an outside agency and is uploaded online so it must...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.