Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Recursion using FSO
Message
From
17/05/2001 11:31:44
Robert Herrmann
Tx Dept. of Health - Cancer Registry
Austin, Texas, United States
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00508249
Message ID:
00508336
Views:
22
>Robert,
>>>
>>>You're not missing anything. Not all folders expose all the date/time properties. I was able to duplicate what's happening to you with the following:
lcdir = GETDIR() && Selected the Windows\System folder
>>>oDir = oFSO.GetFolder(lcdir)
>>>? oDir.DateCreated && COM error 0x800a0005
The workaround is that
? TYPE('oDir.DateCreated')
returns "U". If it's "T", then you can access the property.
>>
>>Ouch.. that must've been it.. I just ran it on a slave drive that had no system files in it and it didn't give the error...
>>
>>hmm.. maybe an if.. endif.. statement then where if the type is u it won't try for the .datecreated and if it's t then it will....
>>
>>OR.. I can just tell the network manager tough doodoo. he'll have to settle with just datelastmodified :) but I guess a few extra lines of code won't hurt anything.. :)
>>
>>Thanks for the catch.. I was getting ready to pull my hair out for awhile there :) hehe
>
>You're welcome. You could also try something like:
WITH oFolder
>INSERT INTO filesFSO (Path, Filename, Size, Created, Modified);
>  VALUES (.Path, .Name, .Size, IIF(TYPE('oFolder.DateCreated') # 'U' ,.DateCreated, DATE(1900, 1, 1)), .DateLastModified)
>ENDWITH
It's a minimal change, and would probably require that some other code would have to be modified to recognize the date chosen to represent the fact that the real date couldn't be pulled.

ahh.. I keep forgetting about IIF statements.. yea I like that much better then if.. endif. :) I always prefer cutting code out as apposed to putting code in :)

thanks again
Robert Herrmann
Texas Cancer Registry
Previous
Reply
Map
View

Click here to load this message in the networking platform