Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP6 and script.filesystemobject problems
Message
 
À
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:
00319903
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

Try UPPER(lofilesystem.GetExtensionName(lofile.name)) = "DBF". BTW, you could also use UPPER(JUSTEXT(lofile.name)) = "DBF", in VFP 6.0 or if you load the Foxtools library in prior versions.
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform