Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Structural CDX not found
Message
 
To
17/09/2002 15:21:48
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00701171
Message ID:
00701550
Views:
25
>>I have an application that does the following:
>>
>>1. Looks for the existence of a cdx file to a table (in this case, called aging.cdx. The table name is aging.dbf)
>>
>>2. If the cdx file exists, delete the cdx becuase I want to rebuild the index later in the code.
>>
>>3. open up the table, write data to the table and rebuild the index.
>>
>>4. Once all steps are complete, print report and continue with the next record to be processed.
>>
>>5. The problem is, on all subsequent loops, it gives me the structual cdx not found everytime i try to open the table up without the cdx.
>>
>>Any ideas? or better ways to handle getting a clean index on a table.
>
>lparameter fajl
>cdx=forceext(fajl,'cdx')
>on error
>m.xx=fopen(defaultext(fajl,'dbf'),12)
>if m.xx>0
>        =fseek(m.xx,28),fwrite(m.xx,chr(0)),fclose(m.xx)
>endif
>
>if file(cdx)
>        erase (cdx)
>endif
>
>Just pass it the table name and this will remove the "this table has a structural index" byte in the header, and then erase the cdx. After that, your table has no structural index and does not ask for one. Any referential integrity which may rely on existence of any of these indexes will get marooned - but I figure you've handled that already, or have no such concerns.

Gee, drastic !
Now give us poor fellows the other way around.
I mean, after the INDEX ON it's always nice to have the structural index back, right ?

< g >
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform