Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
>>I've created a view based on an FP table. The view (MyDeliverables) seems to be ok, I can insert, update and delete records through the view from the command line. I've created a form, placed the view in the data environment. Put a grid on the form listing the records from the grid.
>>
>>** FORM1.Init
>>
>>THIS.Grid1.RecordSource=""
>>
>>* Filter Records based on nOSPKey
>>SELECT * FROM MyDeliverables WHERE nOSPKey=THISFORM.t_nOSPKey.VALUE INTO CURSOR Q_Deliv
>>
>>THIS.Grid1.RecordSource="Q_Deliv"
>>THIS.Grid1.Column1.ControlSource="Q_Deliv.cAction"
>>THIS.Grid1.Column2.ControlSource="Q_Deliv.dDueDate"
>>THIS.Grid1.Column3.ControlSource="Q_Deliv.dcomplete"
>>
>>THIS.Grid1.Refresh
>>
>>
>>Put a delete button:
>>
>>** FROM1.cmdDelete.Click
>>
>>SET MULTILOCKS ON
>>= CURSORSETPROP('Buffering', 5, 'MyDeliverables')
>>DELETE FROM MyDeliverables WHERE nDelKey=Q_Deliv.nDelKey
>>* = TABLEUPDATE(.T.)
>>SET MULTILOCKS OFF
>>
>>Put a refresh button:
>>
>>** FORM1.cmdRefresh.Click
>>
>>THIS.Grid1.RecordSource=""
>>
>>SELECT * FROM MyDeliverables WHERE nOSPKey=THISFORM.t_nOSPKey.VALUE INTO CURSOR Q_Deliv
>>
>>THIS.Grid1.RecordSource="Q_Deliv"
>>THIS.Grid1.Column1.ControlSource="Q_Deliv.cAction"
>>THIS.Grid1.Column2.ControlSource="Q_Deliv.dDueDate"
>>THIS.Grid1.Column3.ControlSource="Q_Deliv.dcomplete"
>>
>>THISFORM.Grid1.Refresh
>>
>>When I click on the delete button, the record is delete on the view. When I click on the refresh button the record is still there and when I look at the table the record is still there. I know this all has to do with buffering settings on the form. What am I missing?
>>
>>TIA
>>
>>/Chris
>Chris,
>Is tableupdate() commented ? Uncomment, views are buffered by default. Also include viewname there, it might not be current alias.
>Cetin
I was getting a "Program error - Function requires row or table buffering" so I changed it to =TABLEUPDATE(.t.,.t.,"MyDeliverables"), it now seems to work. Any other suggestions you can pass my way?
/Chris
Précédent
Suivant
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