Link to home
Start Free TrialLog in
Avatar of kpi_it
kpi_it

asked on

error building key for index

Visual FoxPro 09.00.0000.5815 for Windows

I have a table with several indexes that are set as unique.
These indexes have been in place for several years.
Just recently when issuing an append blank I get the error  <error building key for index  workdate.
The index definition is: workcode + dtoc(invodate) - workcode is C(17) and invodate is D.
The is a flock() placed on the file just prior to the append blank.
If I open the same table in a vfp session I can append blank all day.
Not sure where to go next with this issue.
Need to resolve a.s.a.p..
I have done several selects to weed out any invalid dates etc.
Tried the same code on different workstations.
But still the problem remains.

ASKER CERTIFIED SOLUTION
Avatar of jrbbldr
jrbbldr

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kpi_it
kpi_it

ASKER

the switching of dtoc() to dtos() did the trick.
Had thought of it earlier, but didn't think that something that has worked for years.
And has worked the past two years with VFP 9 just would suddenly just stop is weird.
I am glad that the DTOS() did the trick for you.

Just make sure that if you are doing any SEEK's within your application that the expression that you use, also makes use of the DTOS() instead of DTOC() so that your SEEK can actually find what you want.

Good Luck