Mar 30, 2005 #1 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
How could I delete an access database .mdb file using VBA code? Seemingly Docmd.DeleteObject doesn't work for access database file Thanks Jay
Mar 30, 2005 1 #2 SiJP Programmer May 8, 2002 708 GB 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 Upvote 0 Downvote
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
Mar 30, 2005 1 #3 PWise Programmer Dec 12, 2002 2,633 US or try this kill "pathandfilename Upvote 0 Downvote
Mar 30, 2005 Thread starter #4 VBUser77 MIS Jan 19, 2005 95 US Thanks. Do you know how to rename an access file in VBA. Upvote 0 Downvote
Mar 30, 2005 #5 PWise Programmer Dec 12, 2002 2,633 US to copy file FileCopy source, destination to rename Name oldpathname As newpathname Upvote 0 Downvote
Mar 30, 2005 Thread starter #6 VBUser77 MIS Jan 19, 2005 95 US 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 Upvote 0 Downvote
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
Mar 30, 2005 #7 PWise Programmer Dec 12, 2002 2,633 US 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 Upvote 0 Downvote
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