Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Smarter Reindex Form
Message
From
03/11/2000 10:20:47
 
 
To
01/11/2000 16:57:38
General information
Forum:
Visual FoxPro
Category:
Stonefield
Miscellaneous
Thread ID:
00436915
Message ID:
00437621
Views:
17
Hi Rick.

>I'm a new user to SDT, so of course I want to change everything. In an effort to try and not confuse my 'smarter' users, I thought I'd try to create a reindex form that only presents the tables that actually have indexes to recreate.

This seems like one of those things that's so obvious, I can't believe I missed it and no one else asked for it all these years <g>! I guess most folks who use SDT (like me) have at least one index on every table. This change was very easy to make:

- In SDTMgr.Reindex, add the following code above the call to SelectTablesToProcess:
lnTables = This.Parent.DBCXGetAllObjects(lcDBC + '!Table', ;
  @laTables, 'CBcCaption', 'SDTCanUpdate', .T.)
lcDBCName = upper(padr(lcDBC, fsize('cDBCName', 'CoreMeta')))
for lnI = lnTables to 1 step -1
  lcTable = upper(laTables[lnI, 2])
  if not seek(lcDBCName + 'I' + lcTable + '.', 'CoreMeta', ;
    'ObjectName')
    adel(laTables, lnI)
    dimension laTables[alen(laTables, 1) - 1, ;
      alen(laTables, 2)]
  endif not seek(lcDBCName ...
next lnI
- In SDTMgr.SelectTablesToProcess, replace this line:
lnTables = This.Parent.DBCXGetAllObjects(lcDBC + '!Table', @laTables, ;
  'CBcCaption', tcProperty, tuValue)
with:
if empty(taTables[1])
  lnTables = This.Parent.DBCXGetAllObjects(lcDBC + '!Table', @laTables, ;
    'CBcCaption', tcProperty, tuValue)
else
  acopy(taTables, laTables)
  lnTables = alen(laTables, 1)
endif empty(taTables[1])
- Near the end of SDTMgr.SelectTablesToProcess, add the following after the OTHERWISE statement and before the ACOPY statement:
dimension taTables[alen(laTables, 1), alen(laTables, 2)]
>Is there a DBCXGetProp() way to determine whether a given table has an index?

No (at least not without adding an extended HasIndexes property or something like that), so that's why the SEEK statement in the code above.

Thanks for the suggestion!

Doug
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform