My suggestion: there is a vfp program call gendbc.fxp (it comes with vfp) that generates a .prg to recreate all the tables or views contained in a database container. Run that program, it will ask you to a .dbc Give the name of a database that you have created and that have views and let it generate a .prg to you. Then, take a look at .prg generated and you will see how do you set a view programatically to send updates to original tables. Follow the code as a example and set these parameters of the view you created.
By do that this way, you can just update or insert a record on the view, this update or insert will be sent to base table automaticaly.
I use a parameterized view to generate a set data that the user are autorized to see. eg.
I use the following code to creat para view:
SET EXACT OFF
CREAT SQL VIEW vpohead AS;
SELE po,date,amt,perinch,cusid,issue;
FROM po ;
po.perInCh = ?mPer ;
ORDER BY 1
Then I link source table with this view. So if user move the record in view, the source table will also move to same record.
My problem is if the user add/edit a record, which way is better to handle the situation,
1)insert/update the record to both view and table or
2)insert/update the record to source table and requery the view.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement