Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Recursion using FSO
Message
De
17/05/2001 09:58:25
Robert Herrmann
Tx Dept. of Health - Cancer Registry
Austin, Texas, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00508249
Message ID:
00508276
Vues:
25
>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform