Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to retrieve tables name ?
Message
From
18/05/2001 08:33:55
Fausto Garcia
Independent Developer
Lima, Peru
 
 
To
18/05/2001 00:12:58
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00508583
Message ID:
00508635
Views:
20
Hi Chang,

To present the user only the indexed tables of your database you could build a cursor with the following sentences:
*Open your database as a table, note the ".dbc" is required
use your_dbc_name.dbc shared alias db
select a.objectname as tableName ;
   from db a, db b ;
   where b.objecttype="Index" and a.objectid=b.parentid ;
   into cursor indexed_tables
use in "db"
*The "indexed_tables" cursor now has all
*the database's indexed table names
Then you could bind this cursor to the control source of your list box and perform the following when the user selects one of the list's entries:
lctable=alltrim(your_listbox_name.value)
use &lctable exclusive in 0
select &lctable
reindex
Note that you will not be able to "use" your database if it has been already been opened with the OPEN DATABASE command.

Hope this helps!


>Hi,
> I wish to retrieve all the tables name in my database and display it into a list box, that will all user to tick or select the table. Then i will do reindexing for the ticked or selected tables.
> Anyone know how to do it ? thanks.
>
>
>kengwen
Solo se que nada se

Fausto J. Garcia Pino - MCSD.NET
.NET, Oracle, Tronador & Fondismo!
Previous
Reply
Map
View

Click here to load this message in the networking platform