>>>What is the exact code of PrimaryKey() procedure?
>>
>>Don't think I can post that here since this is a purchased framework.
>
>Ok. I think the problem is somewhere it this code. Examine it carefully, especially what would it do in case of errors.
Also make sure that the primary database is opened when this method is executed. What if you have multiple databases open in the same time? Is this function an SP? Which SP is going to be executed first?
If it's not broken, fix it until it is.
My Blog