Has built a table, at the same time the CHK fields corresponding to the checkbox,
KeyList take 1, 0
In event DBGridEh1CellClick code for
If (Column. FieldName='CHK) then the begin
If ADOQuery1. FieldByName (' CHK) AsString='0' then
The begin
ADOQuery1. Edit;
ADOQuery1. FieldByName (' CHK). AsString:='1';
ADOQuery1. Post;
End the else
The begin
ADOQuery1. Edit;
ADOQuery1. FieldByName (' CHK). AsString:='0';
ADOQuery1. Post;
end;
But I found the data in the table of CHK values, always be 0
Excuse me why?
CodePudding user response:
You directly into a bool type CHK, you don't have to write code yourself to switch the state
CodePudding user response:
Use the Boolean field typeCodePudding user response:
1, no Boolean fields in SQL table2, my ultimate goal is to think through judging CHK update other fields (such as name), have what good method, to code, use adoquery, thank you
CodePudding user response: