Re: Create folder from within Access VB
- From: "MikeB" <m.byerleyATVerizonDottieNettie>
- Date: Tue, 22 Jan 2008 07:41:44 -0500
"MikeB" <m.byerleyATVerizonDottieNettie> wrote in message
news:u5fPWLPXIHA.4432@xxxxxxxxxxxxxxxxxxxxxxx
"Ron Weiner" <rweineratworksritedotcom> wrote in message
news:u6wYS1OXIHA.4712@xxxxxxxxxxxxxxxxxxxxxxx
The use of FSO in a scripting environment is fine as this is what it was
designed for and where it belongs. As a former IT admin in a mid size
company with several dozen branch offices, I couldn't have gotten my job
done with out it. I am just saying it should NEVER be used in an Access
Application, and should be considered an EVIL there. As an aside, we had
all scripting turned off in almost all employee workstations as another
level of protection against malware. Your Access application would have
failed there. I suspect we were/are not the only company who had a policy
about allowing employees to run scripts on their workstations.
Ron W
Did you also have DOS Batch files turned off?
Not to continue this line, but I seem to remember that an executable can be
created in / with a batch file, no?
I think that is the source of original virii, IIR... course the first virii
of the 80's usually infected / affected only one box.
A quick google showed a link of how to create an executable with a batch
file. I am not an assembler programmer (required to do this), but even though
the example is of a mundane process, I don't think it is going to take much of
a program to wreak havoc from a batch file.
http://www.palmtoppaper.com/ptphtml/25/pt250058.htm
"MikeB" <m.byerleyATVerizonDottieNettie> wrote in message
news:%231$A10IXIHA.4684@xxxxxxxxxxxxxxxxxxxxxxx
"Ron Weiner" <rweineratworksritedotcom> wrote in message
news:%23%23OOQXIXIHA.2000@xxxxxxxxxxxxxxxxxxxxxxx
Holly Hanna is a mild expletive (kinda' like "Great Caesar's Ghost" Ala
Perry White editoe of the Daily Planet) I use every time I see someone
using the File Scripting Object (FSO) in an Access app. I can not think
of a single reason to use that abomination (FSO) in an Access application.
Everything that can be done using FSO can be done easier, faster, better
using native Access commands, or when there is a need for speed the
Windows API. In fact there are loads of computers out there (especially
in corporate computing environments) that will puke should you try to use
it.
I agree that the available file handling within Access should be used, but
the blanket, wholesale dismissal of the FSO likely would be contested by
(insert whatever your suspension of disbelief will allow for a number) of
sys Admins that use it everyday in the Scripting Environment for which it
was specifically created.
I personally have never experienced a conflict or failure of the FSO (have
used it since NT4, so a while), but I have also never heard anyone sing a
praise of it.. curious not?
Ron W
"Michael T" <michaelj@xxxxxxxxxxxxx> wrote in message
news:bOSdncjMZu07hQjanZ2dnUVZ8tChnZ2d@xxxxxxxxxxxx
Hello Ron,
Thank you for your advice. The help index is not exactly helpful - it's
one of those things where you have to know the nswer before you can ask
the question - I was innocently looking up 'folder' and how to create
them.
I'm sorry but I don't understand your reference to 'holly Hanna' and
'FSO' whoever or whatever she/it/they is/are. Is it some form of joke?
Never mind :-)
Anyway...
Thanks again.
M.
"RDub" <rweinerattrcrentdotcom> wrote in message
news:OlCR7HHXIHA.3940@xxxxxxxxxxxxxxxxxxxxxxx
Why in holly Hanna are you using FSO when you can do it by using a
simple VBA statement? Have a look at the MkDir statement in Access
help.
Ron W
"Michael T" <michaelj@xxxxxxxxxxxxx> wrote in message
news:6vWdnSCJFJVfmwjanZ2dnUVZ8vOdnZ2d@xxxxxxxxxxxx
Please will you advise on the following:
I am trying to create a folder on the C drive of my PC from within
Access VB. Hunting through the Access VB help files has got me the
following but there are no examples and I get a message that "ActiveX
component can't create object" in line 4 below (Set fs..) when I
execute it.
Public Function CreateFolder(strFolderName As String)
Dim objTemp As Object
Dim fs As Object
Set fs = CreateObject("Scripting.FilesSystemObject")
Set objTemp = fs.CreateFolder(strFolderName)
Set objTemp = Null
Set fs = Null
/* Ignore any errors and just send back OK
CreateFolder = "OK"
End Function
I just call this with the folder name:
strResult = CreateFolder("C:\foldertest") with and without trailing \
gives the same error.
I guess I don't understand how/why I need to create a system object -
the syntax for the actual create seems to be simple.
Help appreciated.
Michael.
.
- Follow-Ups:
- Re: Create folder from within Access VB
- From: RDub
- Re: Create folder from within Access VB
- References:
- Create folder from within Access VB
- From: Michael T
- Re: Create folder from within Access VB
- From: RDub
- Re: Create folder from within Access VB
- From: Michael T
- Re: Create folder from within Access VB
- From: Ron Weiner
- Re: Create folder from within Access VB
- From: MikeB
- Re: Create folder from within Access VB
- From: Ron Weiner
- Re: Create folder from within Access VB
- From: MikeB
- Create folder from within Access VB
- Prev by Date: Re: Create folder from within Access VB
- Next by Date: Re: Identify the current Function / sub etc.
- Previous by thread: Re: Create folder from within Access VB
- Next by thread: Re: Create folder from within Access VB
- Index(es):
Relevant Pages
|