Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Table not found
Message
De
14/07/2007 08:41:00
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
14/07/2007 05:49:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01240437
Message ID:
01240442
Vues:
16
>hi all,
>any idea , help
>thanks.
>
>use "tax"+thisform.combo1.Value
>
>if !found() &&mean  "tax"+thisform.combo1.Value.dbf
>   =messagebox("table not found")
>else
>.
>.
>endif
>
First, to make debugging and program maintenance easier, store the table name into a variable. It is awkward to use the same complicated expression several times in the same program. In this case, "tax" + ThisForm.Combo1.Value.

Just in case the above is real code, a ComboBox should NOT be named "Combo1". You should give it a name like CboFilename, i.e., it should start with "Cbo", and then a meaningful name. For sample code, or for a quick test, "Combo1" is acceptable.

To get the filename, make sure the .DBF extension is included, for example:
lcFileName = DefaultExt(ThisForm.Combo1.Value, "dbf")
Now, to find out if the filename actually exists, use one of the following:
1.
if file(lcFilename)

2.
if adir(laFileList, lcFileName) > 0
Option (1) will return .T. if the file is found anywhere among the search path (see "set path"), or even in the EXE. Therefore, option (2) is usually deemed safer.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform