我的数据库是sql server 2000 sex 字段是 bit 型的
if RadioButton1.Checked:=true then
query1.FieldByName('sex').AsBoolean := true
else
begin RadioButton2.Checked:=true ;
query1.FieldByName('sex').AsBoolean := false;
end;
运行错误
[Error] zjyh.pas(136): ':=' expected but '=' found
[Fatal Error] money.dpr(10): Could not compile used unit 'zjyh.pas'
if RadioButton1.Checked:=true then
query1.FieldByName('sex').AsBoolean := true
else
begin RadioButton2.Checked:=true ;
query1.FieldByName('sex').AsBoolean := false;
end;
运行错误
[Error] zjyh.pas(136): ':=' expected but '=' found
[Fatal Error] money.dpr(10): Could not compile used unit 'zjyh.pas'
改为:if RadioButton1.Checked=true then
query1.FieldByName('sex').AsBoolean := true
else
begin
RadioButton2.Checked := true;
query1.FieldByName('sex').AsBoolean := false;
end;
if RadioButton1.Checked:=true then
--》
if RadioButton1.Checked=true then
query1.FieldByName('sex').AsBoolean:=true
else
begin
RadioButton2.Checked:=true;
query1.FieldByName('sex').AsBoolean:=false;
end;