Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP6 and script.filesystemobject problems
Message
De
19/01/2000 10:34:56
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
19/01/2000 09:59:24
Daniel Murphy
National Auto Finance, Inc.
Jacksonville, Floride, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00319866
Message ID:
00319898
Vues:
12
>Does anyone know why these lines of code wont work?
>What happens is.. The filesystemobject is created fin and the 2 for loops start and the INSERT command works the first time. But after the INSERT it totally hangs... DEAD VFP6! If I dont have the INSERT statement in there it works fine. So it must have something to do with the combination between using the filesystemobject and trying to use the SQL - INSERT command. I must be doing something fundamentally wrong or have found an obsure bug. I appreciate all your feedback in advance.
>
>****
>*The purpose of this prg is to
>*find all of the free tables in our class system
>*
>*1. Find all tables in our system
>*2. Find all tables in our DBC's
>*compare lists
>SET STEP ON
>CLOSE ALL
>cClassDir = "e:\class\"
>cSaveDir = "e:\data\findfree\"
>CREATE TABLE (cSaveDir +"classtables") ;
> (tablename c(15), ;
> tablepath C(30) ,;
> dbcname C(30) ,;
> lastaccess D ,;
> InDBC L)
>curtable=""
>***Create filesystem object
>lofilesystem=createobject("scripting.filesystemobject")
>lofolder=lofilesystem.getfolder(cClassDir)
>***Loop throiugh all subfolders
>FOR EACH losubfolder IN loFolder.SubFolders
> FOR EACH lofile IN losubfolder.files
> IF lofilesystem.GetExtensionName(lofile.name) = "DBF"
> INSERT INTO classtables (;
> tablename,;
> tablepath,;
> lastaccess,;
> InDBC;
> ) VALUES (;
> lofile.name,;
> lofile.path,;
> lofile.DateLastAccessed,;
> .F.)
> ENDIF
> ENDFOR
>ENDFOR
>INDEX ON tablename TAG tablename


Daniel,
I'm not sure if this maybe the problem. Try this :
FOR EACH losubfolder IN loFolder.SubFolders
  if loSubFolder.Name # "System Volume Information"
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform