Fso.deletefile Error 70
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions runtime error 70 permission denied vba you might have Meta Discuss the workings and policies of this vba delete file permission denied site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers filesystemobject deletefile permission denied or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a runtime error 70 permission denied vba filesystemobject community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up MS Access 2007 VBA FSO.DeleteFile Error 70 Permission Denyed up vote 2 down vote favorite When I try to delete a file with FSO.DeleteFile I get 'Error 70 Persmission Denyed'. When I try
Vba Close File
to use the Kill command I get 'Error 75 Path/File access error'. I have read/write privileges to the folder, though it is on a network drive not a local drive. Here's my code: Private Sub DeleteFileButton_Click() On Error GoTo Err_DeleteFileButton_Click Dim FileLocation As String Dim strSQL As String FileLocation = DLookup("AttachmentLink", "dbo_tbl208Attachments", "ATID = " & Me.lstFiles.Column(1)) strSQL = "DELETE FROM dbo_tbl208Attachments WHERE ATID = " & Me.lstFiles.Column(1) With New Scripting.FileSystemObject .DeleteFile FileLocation End With 'Kill FileLocation CurrentDb.Execute strSQL, dbFailOnError MsgBox "File has been deleted" Exit_DeleteFileButton_Click: Exit Sub Err_DeleteFileButton_Click: MsgBox Err.Number & " - " & Err.Description Resume Exit_DeleteFileButton_Click End Sub ms-access-2007 access-vba share|improve this question asked Nov 30 '12 at 21:38 Donnachaidh 5918 FileLocation holds the correct file path (I copy and pasted it into Windows Explorer and the file came up). But Dir(FileLocation) just shows the file name, nothing else. –Donnachaidh Dec 3 '12 at 20:54 I am able to delete the
Custom Search UtterAccess Forums>Microsoft® Access>Access Modules Delete A File - Permission Denied Error 70, Access 2007 Forum HomeSearchHelpUA Messages|-- UtterAccess.com NewsAccess Knowledge Center|-- Access Code Archive|-- Access Knowledgebase / FAQ|-- Access TutorialsMicrosoft® Access|-- Local Access User Groups (AUGs)|-- Interface Design|-- Access Q and A|-- Access Tables + Relationships|-- Access Queries|-- Access Forms|-- Access Reports|-- Access Macros|-- Access Modules|-- Access Date + Time|-- Access Errors + Error Handling|-- Access http://stackoverflow.com/questions/13653566/ms-access-2007-vba-fso-deletefile-error-70-permission-denyed Built-in Functions|-- Access Searching + Data Mining|-- Access Records|-- Access Security|-- Access Automation|-- Access Database Container|-- Tool bars, Menu bars + Ribbon|-- Access Services (Web Databases)|-- Access Data Access Pages (Deprecated)|-- Access Data Projects - ADP|-- Access Runtime, Packaging & DeploymentAnd More...|-- Microsoft SQL Server|-- SQL Server Reporting Services|-- Microsoft SharePoint|-- http://www.utteraccess.com/forum/delete-file-permission-t1990519.html Microsoft Internet Explorer|-- Visual Basic 6 and Earlier|-- Visual Basic 2003 and Later|-- ASP and VBScript|-- Web Development|-- PHP, Perl, MySQL and Postgres|-- Other Database Engines|-- BI Tools and Applications|-- JAVA and C#|-- GraphicsMicrosoft® Office|-- Microsoft Excel|-- Microsoft Excel FAQs|-- Microsoft Word|-- Microsoft Outlook|-- Microsoft PowerPoint|-- Microsoft FrontPage/Exp. Web|-- Other Microsoft ProductsPC|-- Network Issues|-- Q & A - Hardware|-- Q & A - Software|-- Q & A - Other PC|-- Virus + Security DiscussionUtterAccess Odds and Ends|-- General Chat|-- Q & A - UtterAccess.com Forums|-- Q & A - Access Wiki Options dhappView Member Profile Jul 14 2012, 09:02 PM Post#1Posts: 1,038Joined: 17-November 03From: Hamburg, NYI'm trying to delete a file from a specific folder using vba.I have tried simply Kill(Killfile) as well as the code below.In both cases I get an error code 70; Permission denied.On the code below I get the message "That file exists, delete
If this is your first visit, be sure to check out the FAQ by clicking the link http://www.vbforums.com/showthread.php?609161-run-time-error-70-Permission-Denied above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you http://www.tek-tips.com/viewthread.cfm?qid=1688358 want to visit from the selection below. Results 1 to 10 of 10 Thread: run time error 70 Permission Denied Tweet Thread Tools Show Printable Version permission denied Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Mar 29th, 2010,09:45 AM #1 enigmagirl122 View Profile View Forum Posts Thread Starter Addicted Member Join Date Feb 2009 Posts 211 run time error 70 Permission Denied Hello I'm using ms access as my database in vb6.When runtime error 70 i'm trying to restore my database i get "Permission Denied" for further details here is my code: Code: Dim stmpFP As String Dim FSO As New FileSystemObject DBPathFileName = App.Path & "\database\tms.mdb" If listBF.ListItems.Count < 1 Then MsgBox "There is no Backup File to restore.", vbExclamation GoTo ReleaseAndExit End If If Not FSO.FileExists(txtBF.Text) Then MsgBox "Please enter valid backup file name", vbExclamation GoTo ReleaseAndExit End If cmdCancel.Enabled = False lblStartMsg.Visible = False progCopy.Visible = True cmdStart.Enabled = False Set clsHuf = New clsHuffman stmpFP = FSO.GetSpecialFolder(2).Name & "DIMS1tmpCF.tmp" ' On Error GoTo errh If FSO.FileExists(stmpFP) = True Then FSO.DeleteFile stmpFP End If clsHuf.DecodeFile txtBF.Text, stmpFP progCopy.Visible = False lblStartMsg.Caption = "Copying File, please wait..." lblStartMsg.Visible = True DoEvents If MsgBox("Do you want to overwrite the current Database file wth this newly restored file?", vbQuestion + vbOKCancel) = vbOK Then 'close databse mod_con.cn.Close 'delete current db file If FSO.FileExists(DBPathFileName) = True Then FSO.DeleteFile DBPathFileName
Join INTELLIGENT WORK FORUMSFOR COMPUTER PROFESSIONALS Log In Come Join Us! Are you aComputer / IT professional?Join Tek-Tips Forums! Talk With Other Members Be Notified Of ResponsesTo Your Posts Keyword Search One-Click Access To YourFavorite Forums Automated SignaturesOn Your Posts Best Of All, It's Free! Join Us! *Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail. Posting Guidelines Promoting, selling, recruiting, coursework and thesis posting is forbidden.Tek-Tips Posting Policies Jobs Jobs from Indeed What: Where: jobs by Link To This Forum! Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.Just copy and paste the BBCode HTML Markdown MediaWiki reStructuredText code below into your site. Microsoft: Access Modules (VBA Coding) Forum at Tek-Tips HomeForumsProgrammersDBMS PackagesMicrosoft: Access Modules (VBA Coding) Forum MS Access 2010 vba got error on either move or delete folder - run time error 70, permission denied thread705-1688358 Forum Search FAQs Links MVPs MS Access 2010 vba got error on either move or delete folder - run time error 70, permission denied MS Access 2010 vba got error on either move or delete folder - run time error 70, permission denied tnguyen315 (MIS) (OP) 16 Jul 12 15:13 I have an access database and it's been working for years, suddenly my code stop working on movefolder ....I have full control on admin... I tried to search but nothing works, please help... My code: Private Sub cmdClose_Click() Dim dest As String Dim NewDest As String Dim NewDest1 As String Dim src As String Dim FSO As New Scripting.FileSystemObject dest = "\\Mosquito\Adulticide-Test\Docs\ImportsOps" NewDest = \\Mosquito\Adulticide-Test\Docs\ArchivedOps\" DoCmd.Hourglass True If FSO.FolderExists(dest) Then If FSO.FolderExists(NewDest & Format(Date, "mm-dd-yyyy")) Then FSO.DeleteFold