Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Index does not match file
Message
 
To
18/09/2017 07:09:46
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01654385
Message ID:
01654409
Views:
48
>>>>>>>>I am getting index does not match the file - is there any easy way of finding our which file that is - it is a very large system with masses of files
>>>>>>>>
>>>>>>>>Thanks
>>>>>>>>
>>>>>>>>Colin
>>>>>>>
>>>>>>>No easy way, other than opening the tables one by one. If all the tables are in the same folder, you can easily create a program to do this with Sys(2000) in a loop.
>>>>>>>
>>>>>>>If the system had a proper error handler, it would have shown you which table it was, since this error will appear on the line where you open the tabl
>>>>>>
>>>>>>Any chance you could give me a quick program checking all files in j:\global
>>>>>
>>>>>This simple program will give an error message if opening a table fails, and if you don't have an error handler active. Nothing advanced, I wrote this program in a few minutes to comply with your wish.
>>>>>
>>>>>
lparameters tcDir , tcSkeleton
>>>>>if empty(tcDir)
>>>>>   tcDir = 'data'
>>>>>endif
>>>>>if empty(tcSkeleton)
>>>>>   tcSkeleton = '*.dbf'
>>>>>Endif
>>>>>tcSkeleton = forcepath(tcSkeleton,tcDir)
>>>>>llFirst = .T.
>>>>>clear
>>>>>do while .t.
>>>>>   if llFirst
>>>>>      lcFile = sys(2000, tcSkeleton)
>>>>>      llFirst = .F.
>>>>>   else
>>>>>      lcFile = sys(2000, tcSkeleton, 1)
>>>>>   endif   
>>>>>   if !empty(lcFIle)
>>>>>      lcFile = forcepath(lcFile, tcDir)
>>>>>      use (lcFile)
>>>>>      ?lcFile
>>>>>   else
>>>>>      exit
>>>>>   Endif
>>>>>Enddo
>>>>>
>>>>>Please note that I am not sure that an index corruption will always raise an error.
>>>>
>>>>Thanks but I get unrecognised command verb on the line lparameters tcDir, tcSkeleton
>>>
>>>I don't. Which version of VFP do you use?
>>
>>I was trying to specify the directory this caused the error - my files are in j:\global how do I specify this in the code
>
>The first parameter is tcDir, should give you an idea... :-)

That works - thanks a lot
Specialist in Advertising, Marketing, especially Direct Marketing

I run courses in Business Management and Marketing
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform