Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Debugging
Message
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Title:
Miscellaneous
Thread ID:
00324449
Message ID:
00326545
Views:
26
>>Paul,
>>
>>Speaking of errors, did you figure out what was causing the duplicate primary keys in your code?
>
>Well, I got it fixed but to be honest I'm not entirely sure why, or what, was causing the problem. I removed all the auto-requery stuff from my parent and my child bizobj and the problem went away. I had made a few other changes at the same time, but I think it was the requerying that did it. I had been hoping to post a nice followup message with an explaination of what had been happening, but it doesn't look like that's going to happen.

I always prefer cleanliness too, but that's not always the case. It may come back to haunt you. Take a look at the OnNew() method. I just realized that I was having the same problem when I was importing files into a bizobj. I was scanning a cursor and adding records to a bizobj by using insert sql statements. The bizobj would automatically create a new primary key, but the save method wouldn't know a primary key had already been created and would fire off the newid() method. I finaly cured the problem by calling the OnNew method manually before the save method. It took a while but I finally figured out what was happening. If the framework has one weakness, I would have to say it is when importing data into bizobjects. I still havn't found a really clean way of doing it.
Previous
Reply
Map
View

Click here to load this message in the networking platform