PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → HBuildKey error
HBuildKey error
Débuté par John Marrone, 24 sep. 2008 01:55 - 4 réponses
Posté le 24 septembre 2008 - 01:55
Hi All
I have a problem. I have created 6 tables. 2 of them have composite keys. 1 table is called workouts. When I run the program I get the error ->HBuildKey function called. No item found in Entries file. Error code 70202. I am adding data to the workouts table. I am building the key ->dateHrsName = HBuildKeyValue(Wokouts.date_of_workouthorse,rd[index, 101 + i] ,rd[index,45]). What has this got to do with the entries table. The entries table is not even linked to the workouts table. I am in the local procedure ImportWorkoutsData. I just got threw importing data into the entries table before I called this procedure?? Am I not in the right work area And I don't think WD has work areas but I am really reaching on this one.

Here is my could. It errors out at the HBuildKey line.
PROCEDURE ImportWorkoutsData(index is int)
LOCAL
i is a int
dateHrsName is a string

IF rd[index,5] = "S" THEN RETURN
FOR i = 1 TO 10
IF rd[index, 101 + i] = "" THEN
RETURN
END
dateHrsName = HBuildKeyValue(Wokouts.date_of_workouthorse,rd[index, 101 + i] ,rd[index,45]) HBuildKey function called. No item found in Entries file. Error code 70202. Hope somebody can help me here. I can not figure this out.
END
Posté le 24 septembre 2008 - 01:54
Hi All
I have got it working by switching to this code and not using HBuildkey.
HReadSeekFirst(Wokouts, date_of_workouthorse,[rd[index, 101 + i], rd[index,45]])

This way you do not have to build a composite key. I still don't understand why it would not work right the other way. I looked in help under HBuildKey and the help recommended to use this method as it is quicker.
Thought others might want to know this.
Thanks for you time and effort.
Posté le 24 septembre 2008 - 01:55
Hello,
It actually does work but there's a typo in your code. Wokouts.date_of_workouthorse this will result in the date you mentioned.
[code]
dateHrsName = HBuildKeyValue(Wokouts.date_of_workouthorse,rd[index, 101 + i] ,rd[index,45])
Posté le 24 septembre 2008 - 01:55
Thanks, I work alone so I don't have an other pair of eyes to look at the code. Thanks I should of guessed that cause I know how to use the function. I knew it had to be me.
Posté le 24 septembre 2008 - 01:56
Hi John,
I also use the second way of searching on comp keys.
I have had a quick look on your code : I think the point after your filename should be replaced by an comma.
dateHrsName = HBuildKeyValue(Wokouts[size=x-large][color=#FF0000].[/color][/size]date_of_workouthorse,rd[index, 101 + i] ,rd[index,45])
must be
dateHrsName = HBuildKeyValue(Wokouts[size=x-large][color=#FF0000],[/color][/size]date_of_workouthorse,rd[index, 101 + i] ,rd[index,45])

regards,
Joris.