Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Remedial Transaction/Buffering/View Question
Message
From
28/03/1998 12:30:27
Stephen Bridgett
Stephen Bridgett Consulting
Gloucester, Ontario, Canada
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00085516
Message ID:
00087917
Views:
38
>>I have an updateable, parameterized view that I insert a record into:
>>
>>INSERT INTO cuecards!cueCards (cue, phrase ) ;
>> VALUES ( this.parent.card.Value, oKey.Value )
>>BEGIN TRANSACTION
>> IF TableUpdate(.T., .T., 'cuecards' )
>>
>>The table's ID field has a default value of GetID(). The function executes at that TableUpdate (not surprising), but when I look at the view's ID field (this is the primary key field), there's no value assigned. However, by the time I close the form, the field does have the value, okay.
>>
>>So, obviously, the view doesn't get refreshed with the table values. Obvious now, anyway. (Hey, I'm a beginner with views :-). How
>>can I requery the view? Or is this just basically the wrong way to go about using views?
>>
>>TIA
>Nancy,
>
>You have to look at this as two separate data stores that are only linked during teh update and/or the requery.
>
>You put a new record in the view without an ID
>You tableupdate the view
> this writes the data to the table and because the ID is blank the table
>fire its default for that field
>
>Now if you look in the view you have the record without an id, and if you look in the table you have the record with the id. How to fix this;
>
> Requery("TheView")
>
>to get the data from the table.

What about extending this sceneio (can never spell that word). I am doing all of this within a transaction. If a separate form or user queries the table, the new value will not be there until the first form or user ends the transaction. This has caused me a problem or two. For example, imagine an ID table shared by all forms and or users. How do I get a new ID when the id table isn't updated until the first transaction ends. ?

Nancy, seems like everytime I'm stuck Jim's name shows up ;)
Stephen Bridgett
Hand Crafted Relational Database Solutions
Focusing on Visual Foxpro and Object Oriented Design
SBridgett@cyberus.ca
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform