Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Recursion using FSO
Message
From
17/05/2001 09:58:25
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:
00508276
Views:
26
>>when doing a recursive dir listing using the scripting.filesystemobject method. In the insert command I am using the following:
>>
>>INSERT INTO filesFSO (Path, Filename, Size, Created, Modified);
>>VALUES (.Path, .Name, .Size, .DateCreated, .DateLastModified)
>>
>>at which point i get a OLE error code 0x800a0005: Unknown COM status code msg box.
>>
>>BUT, when I leave the .DateCreated out, it runs just fine. Takes forever but it runs :)
>>
>>Any ideas what is causing this error to creep up with the .DateCreated?
>>
>>TIA!
>
>Robert,
>
>The following works fine for me
lcfile = GETFILE("*")
>IF NOT EMPTY(lcfile)
>  oFSO = CREATEOBJECT("Scripting.FileSystemObject")
>  CREATE CURSOR filesFSO (Path M, FileName M, Size I, Created T, Modified T)
>  oFile = oFSO.GetFile(lcfile)
>  WITH oFile
>    INSERT INTO filesFSO (Path, Filename, Size, Created, Modified);
>    VALUES (.Path, .Name, .Size, .DateCreated, .DateLastModified)
>  ENDWITH
>ENDIF
Hmmm.. I'm missing something here then.. Here's part of what I'm using...
FUNCTION RecurseFolderFSO
LPARAMETER toFolderObject
WITH toFolderObject
   FOR EACH oFile IN .Files
      WITH oFile
         INSERT INTO filesFSO (Path, Filename, Size, Created, Modified);
             VALUES (.Path, .Name, .Size, .DateCreated, .DateLastModified)
      ENDWITH
   ENDFOR
   FOR EACH oSubFolder in .SubFolders
      RecurseFolderFSO(oSubFolder)
   ENDFOR
ENDWITH
Robert Herrmann
Texas Cancer Registry
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform