Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

delete all access tables with a prefix

Posted on 2015-01-26
2
Medium Priority
?
164 Views
Last Modified: 2015-08-03
I have a list of tables in an access mdb ... i want to delete all tables with a particular prefix within the mdb and delete the tables in a directory with the same table names.  For example:  tables -- sample_1, sample_2 ... (all tables beginning with "sample" would be deleted) and a directory "C:/" ... there are tables sample_1.xls, sample_2.xls, ... these table would also be deleted.
0
Comment
Question by:SFWolverine
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40571332
this codes will delecte all tables with prefix mentioned above in the db

dim db as dao.database, td as dao.tabledef

for each td in db.tabledefs
if td.name like "sample_*" then
   db.execute "drop table " & "[" & td.name & "]"
next
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 40571448
to delete the excel files

dim strPath as string, xlFile as string
strPath="C:\"
xlFile=dir(strPath & "*.xls")
while xlFile <>""
    if xlfile like "sample_*" then
       kill strPath & xlFile
    end if
    xlFile=dir
wend
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question