Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
If a table name is a varible ,How to judge it be used()
Message
From
11/06/2002 11:48:08
 
 
To
11/06/2002 10:49:30
Michale Chen
Shijiazhuang ZhiYuan Crop.
Shijiazhuang, China
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00666937
Message ID:
00666962
Views:
16
Hi Michale.

>public theyear ,themonth, tablename
>theyear=''2002''
>themonth=''06''
>tablename=''''
>
>tablename=allt(theyear)+''Äê''+allt(themonth)+''ÔÂ''
>if not used(tablename)
>....
>endif

As Chris pointed out, you need to assign an alias to the table when you open it. The problem is that the table name starts with a number (2002 in this example), which isn't a valid alias, so VFP will assign it an alias based on the workarea (such as W25). Instead, open the table like this:
IF NOT USED('MYTABLE')
  USE (TableName) ALIAS MYTABLE
ENDIF
Doug
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform