Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Table not found
Message
From
14/07/2007 08:41:00
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
14/07/2007 05:49:52
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01240437
Message ID:
01240442
Views:
15
>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)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform