Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determining Available Indexes for a VFP table, using SPT
Message
From
02/09/2002 12:54:32
 
 
To
02/09/2002 05:52:31
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00693965
Message ID:
00695974
Views:
15
Hi Mace,

I'll be using that piece of code to retrieve indexes of tables that can be acessed via an ODBC data source. Some times they'll be in a database (DBC) other times they'll be free tables.

In the same way, as you suggested:
?SQLEXEC( gVFPHandle, "Select KEY(2, 'table1') from table1 where recno()=1")
Do you think it would be possible to use a sequence that would do much the same as (using the appropriate SQLexec statements, as above):
Use Table1

For nCount = 1 TO 254

   If Empty (Tag (nCount))
      Exit
   endif

   wait window Tag (nCount) + chr (13) + Key (nCount)

EndFor

Use
Thanks for your reply!

Fernando



>Hello,

>It is possible to select information directly from the dbc, so for example to get a list of all the indexes you could do something like:

>SQLexec (gVFPHandle, "Select * from data1.dbc where objecttype = 'Index'", "CurIndexes")

>This could easily be scoped to return indexes for a specific table using the objectid and parentid fields.

>To retrieve the expression, you could loop the indexes and select the key(). Eg:

>?SQLEXEC( gVFPHandle, "Select KEY(2, 'table1') from table1 where recno()=1")

>Unfortunately, the where recno = 1 is required so that you do not get an expression for every record... and it assumes you have at least one record.

>Is this what you where after?

>Mace
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform