Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Date problems when importing excel files.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00312458
Message ID:
00312647
Vues:
23
Hi John,

>Regardless, there is nothing preventing you from catching this in your import routine, unless of course, you are relying on Append From x Type XLS....
>
>If you are, you will need to use Automation Techniques instead, so you can fix the values...
>

This is not true. You can validate data in an append from command by using a UDF:
Append from myfile.xls type xls for IsValidDate()

*IsValidDate.prg

if myDateField > {^1900/1/1} && or whatever test you need to validate
  * Return .T. and record will be appended
  llAppendIt = .t.
else
  * Log/handle exception
  * ...
  * Return .F. and the record will not be appended
  llAppendIT = .f.
endif

return llAppendIt
kenweber
GCom2 Solutions
Microsoft Certified Professional

Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform