Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to delete an access database .mdb file using VBA code? 2

Status
Not open for further replies.

VBUser77

MIS
Jan 19, 2005
95
US
How could I delete an access database .mdb file using VBA code?

Seemingly Docmd.DeleteObject doesn't work for access database file

Thanks

Jay
 
Well, as long as it is not the current database you are in...

Dim fso as Object
Set fso = CreateObject("Scripting.FileSystemObject")
fso.DeleteFile myfilelocation
Set fso = nothing




------------------------
Hit any User to continue
 
Thanks. Do you know how to rename an access file in VBA.
 
to copy file
FileCopy source, destination

to rename
Name oldpathname As newpathname
 
The rename thing works so fine. Thanks a lot.

Is there a way in VBA to create .mde file from an existing .mdb file.

Thanks

Jay
 
this will create a new .mdb
Dim a As Access.Application
Set a = CreateObject("Access.Application.9")
a.NewCurrentDatabase "c:\a.mdb"
a.Quit

this will create a new .adp
Application.CreateAccessProject "c:\a.adp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top