Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to retrieve tables name ?
Message
De
18/05/2001 08:33:55
Fausto Garcia
Independent Developer
Lima, Pérou
 
 
À
18/05/2001 00:12:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00508583
Message ID:
00508635
Vues:
19
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!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform