Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Appending from several tables
Message
 
 
À
19/04/2007 18:02:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01217264
Message ID:
01218071
Vues:
19
This message has been marked as a message which has helped to the initial question of the thread.
>>>Naomi
>>>
>>>The code is just as below
>>>Do you think it's able to append from tables of
>>>an old folder to a new folder, even if the new folder has
>>>more tables than the older one ?
>>>
>>>lnOldTables = adir(laOldTables, MyOldPath + "*.dbf")
>>>lnNewTables = adir(laNewTables, MyNewPath + "*.dbf")
>>>
>>>for lnI = 1 to lnNewTables
>>>   lnRow = ascan(laOldTables, laNewTables[m.lnI,1],1,-1,1,15)
>>>    if lnRow > 0
>>>    wait window timeout 2 "Importing from file " + laOldTables[m.lni,1]
>>>         use (laNewTables[m.lnI,1]) exclusive in 0 alias NewData
>>>         zap
>>>         append from (myOldPath + laOldTables[m.lnRow,1])
>>>         use in NewData
>>>  endif
>>>NEXT
>>
>>I don't see a bug here, so I think it should work.
>
>Am I missing something here????
>
>use (laNewTables[m.lnI,1]) exclusive in 0 alias NewData
>zap
>etc
>
>NewData is never SELECTed so unless there is no file open in the current workarea, the wrong file will be zapped and appended to.

Right, missed that. I think I was pointing on this ommission in one of my prior messages.

But using try/catch approach eliminates the need to check the array of old tables.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform