Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
NewID() - how does it work?
Message
From
03/03/2004 10:11:00
Scott Malinowski
Arizona Fox Software LLC
Arizona, United States
 
 
To
02/03/2004 18:45:22
Jason Mesches
Ocean Systems Engineering Corporation
Carlsbad, California, United States
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00882543
Message ID:
00882697
Views:
18
Jason,

As usual, your help fixed the problem completely!!!! Thank you, thank you, thank you...



>Scott,
>Make sure your PK field is updatable in the view. Otherwise, NewID() will fire twice... once in the view, and then again when the update happens in the VFP dbc.
>
>Hope that helps,
>---J
>
>>Greetings!
>>
>>I have a business object on a form that I am using just to add records when a certain event occurs in a different business object. The event causes a custom form method to be called and a business objects records are processed in a SCAN. Records are added to the business object I mentioned first during this SCAN.
>>
>>I have set the business object that I am adding records to as the Primary Business Object on the form. Also, I use NEWID() for all primary keys in this system since everything is done through views, some a little complex.
>>
>>Here's some of the code:
>>
>>SELECT SCANnedView
>>
>>SCAN
>>
>> Thisform.bizobjname.new()
>>
>> REPLACE some non-PRIMARY KEY information in the bizobjview && view associated with the busines object)
>>
>> Thisform.save(.f.,.t.) && save the primary business object just added record
>>
>> lnID = v_bizobjview.PKID && Save the PK ID because I need to update the SCANned View with the value
>>
>> REPLACE foreignkey with lnID in SCANnedView
>>
>>ENDSCAN
>>
>>This appears to be ok...however, the lnID will contain a value, like 28. But, when I close the application and go look at the table that was updated by v_bizobjview, the value is 29????
>>
>>Also, I noticed that the NEWID() method seems to skip numbers for every single record in every single table that I am using? There must be something I am missing here?
>>
>>Any ideas?
>>
>>Thanks!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform