My Assistant
![]()
Custom Search
|
![]() ![]() |
![]() |
![]() Post#1 | |
![]() Posts: 545 Joined: 3-April 12 From: L.A. (lower Alabama) ![]() | Needing to delete file and do other file/folder operations. See that the FileSystemObject looks good for this... but I also see examples where the FileSystemObject is not used for this purpose. The question is... Is there and reason in a company network database where I would be better served doing this kind of operation one way or the other? Any gotcha out there or qualification? Thanks in advance. |
![]() Post#2 | |
![]() UtterAccess VIP Posts: 5,872 Joined: 30-June 11 ![]() | Access has the Kill statement to delete files. As for "other file/folder operations" you'd need to elaborate for us to guide you better. Everything depends on you needs. You may wish to use APIs so deleted file go to the recycle bin instead of just vanishing so if ever there is a mishap they can be retrieved, then again you may like it to just vanish. More information is needed. -------------------- Daniel Pineault (2010-2017 Microsoft MVP) Professional Help: http://www.cardaconsultants.com Free MS Access Code, Tips, Tricks and Samples: http://www.devhut.net * Design should never say "Look at me". It should always say "Look at this". -- David Craib * A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions) |
![]() Post#3 | |
![]() Posts: 545 Joined: 3-April 12 From: L.A. (lower Alabama) ![]() | I have a network database application in progress for PDF files. When the application finds a PDF file in the folder is parses the name for information then.... copies the PDF from the 'Reviewed Files" to another network location. After the copy then I need the original PDF found in 'Reviewed Files' to go away forever. It seems from what I have read that the FileSystemObject is a scripting method and that there is a non-scripting way through VBA to accomplish file operations. What I have to have is fast and reliable on a corporate network. Thank you. |
![]() Post#4 | |
![]() UtterAccess VIP Posts: 5,872 Joined: 30-June 11 ![]() | I'd simply used: Kill statement FileCopy statement (I have a function which employs this with error handling, see: http://www.devhut.net/2010/09/29/ms-access-VBA-copy-a-file/) but there is nothing wrong with employing the FileSystemObject. Whatever you are more comfortable with at the end of the day. -------------------- Daniel Pineault (2010-2017 Microsoft MVP) Professional Help: http://www.cardaconsultants.com Free MS Access Code, Tips, Tricks and Samples: http://www.devhut.net * Design should never say "Look at me". It should always say "Look at this". -- David Craib * A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions) |
![]() Post#5 | |
![]() Posts: 545 Joined: 3-April 12 From: L.A. (lower Alabama) ![]() | Thanks for the information! Simply put is using the FileSystemObject and scripting method any slower than VBA code for a database application on a corporate network? What I am comfortable with is not a factor... I have to make sure it works well and fast as can be. |
![]() Post#6 | |
![]() UtterAccess VIP Posts: 5,872 Joined: 30-June 11 ![]() | In my experience, I've never really much of a difference either way, but it wouldn't be hard to setup a test and actually measure the performance on your network. -------------------- Daniel Pineault (2010-2017 Microsoft MVP) Professional Help: http://www.cardaconsultants.com Free MS Access Code, Tips, Tricks and Samples: http://www.devhut.net * Design should never say "Look at me". It should always say "Look at this". -- David Craib * A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions) |
![]() Post#7 | |
![]() Posts: 545 Joined: 3-April 12 From: L.A. (lower Alabama) ![]() | My corporate network spans from rural Alabama to Los Angeles and speed of operation is a huge factor for success of the project. Thank you for your time in being so gracious as to respond. ![]() |
![]() Post#8 | |
![]() UtterAccess VIP Posts: 5,872 Joined: 30-June 11 ![]() | Any time! I truly think you best bet would be to build a simple test routine that iterates through multiple files copying, deleting using the various techniques to evaluate how they each perform on your network. -------------------- Daniel Pineault (2010-2017 Microsoft MVP) Professional Help: http://www.cardaconsultants.com Free MS Access Code, Tips, Tricks and Samples: http://www.devhut.net * Design should never say "Look at me". It should always say "Look at this". -- David Craib * A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions) |
![]() Post#9 | |
![]() UtterAccess Editor Posts: 9,897 Joined: 7-December 09 From: Staten Island, NY, USA ![]() | I've been doing Access/VBA work for more than 15 years now (shudder, I sound old!) and have never come across any compelling reason to use FSO over the basic built-in IO functions of VBA. I tend to prefer the more basic toolset as it's less likely to change. I recall some years around there was some directory read/search method that was popular with FSO which I had always preferred the more simple VBA Dir() approach... some change in FSO killed that, and my code happily continued to motor on ![]() (I tend to take that approach everywhere... these days I (or my company) have touched base on just about every modern development platform, and I'll always prefer solid dependability over shiny new tools) -------------------- Jack D. Leach Dymeng Services | Dymeng Blog | Wrox Technical Contributor UA Wiki: Articles | Function Library | Contributing Kicking it to the Cloud: Transitioning to Azure from a desktop developer's perspective |
![]() Post#10 | |
![]() UtterAccess VIP Posts: 5,872 Joined: 30-June 11 ![]() | I then to agree with Jack on this. The KISS principle is best. But... with one exception, the Dir() function, as I found out one day, you can't use it and within it's own call, try and call a second instance. So, for iterating through subfolders and things like that FSO is the way to go, but for simple I/O stuff, commands like MkDir, Kill, FileCopy, Len, ... make the most sense. -------------------- Daniel Pineault (2010-2017 Microsoft MVP) Professional Help: http://www.cardaconsultants.com Free MS Access Code, Tips, Tricks and Samples: http://www.devhut.net * Design should never say "Look at me". It should always say "Look at this". -- David Craib * A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions) |
![]() Post#11 | |
![]() UtterAccess Editor Posts: 9,897 Joined: 7-December 09 From: Staten Island, NY, USA ![]() | My ignorance saved me on that one ![]() If I had known what I was doing I would have gotten it wrong! Anyway, yea, that behavior of Dir() can be pest... -------------------- Jack D. Leach Dymeng Services | Dymeng Blog | Wrox Technical Contributor UA Wiki: Articles | Function Library | Contributing Kicking it to the Cloud: Transitioning to Azure from a desktop developer's perspective |
![]()
Custom Search
|
![]() | Search Top Lo-Fi | 26th April 2018 - 10:20 AM |