Edit a Record

Easy but not for me

I am trying to put a recordset into edit mode so I can post to it. Everytime it hits the dataset.edit line I get 'Cannot Modify a Read-Only dataset'.
I have tried setting the read-only property to false with no avail.
Using the same UserName and Password I am able to edit the table using ADO.

begin
Board_DataModule.OracleDSAuditUser.ReadOnly := False;
Board_DataModule.OracleDSAuditUser.Edit;
if Board_Datamodule.OracleDSAuditUser.FieldValues['PRESENT'] = 'True' then
Begin
Board_datamodule.OracleDSAuditUser.FieldByName('PRESENT').Asstring := 'False';
Board_dataModule.OracleDSAuditUser.Post;
Sign_In_Out_Btn.Caption := 'Sign Me In';
End
Else
Begin
Board_datamodule.OracleDSAuditUser.FieldByName('PRESENT').Asstring := 'True';
Board_dataModule.OracleDSAuditUser.Post;
Sign_In_Out_Btn.Caption := 'Sign Me Out';
End;
end;

any help would be greatly appreciated
 
For updatable datasets you need to include the rowid in the result set. You query should look something like:

select t.*, t.rowid from table t

The rowid will not show up as a field, it will be used internally to identify records for updates, deletes, refreshes, and locks.

Perhaps this helps?

------------------
Marco Kalter
Allround Automations
 
Back
Top