procedure zzadd;
var
dw:string;
begin
mainform.zzquy.DisableControls;
viewunit.getdwID(viewform.zz_bm.Text,viewform.zz_dw.Text,dw);
with viewform.ADOCommand1 do
begin
CommandText:='insert zz (name,sex,mz,born,jobdate,dw,idcard,zhh,jnpay,gwpay,eachbt,gsbt,gzbt,ylbt,ylj,gjj,syj) '+
'values
name,:sex,:mz,:born,:jobdate,:dw,:idcard,:zhh,:jnpay,:gwpay,:eachbt,:gsbt,:gzbt,:ylbt,:ylj,:gjj,:syj)';
parameters.ParamByName('name').Value:=trim(viewform.zz_name.Text);
parameters.ParamByName('sex').value:=trim(viewform.zz_sex.Text);
parameters.ParamByName('mz').Value:=trim(viewform.zz_mz.Text);
parameters.ParamByName('born').Value:=viewform.zz_born.date;
parameters.ParamByName('jobdate').value:=viewform.zz_jobdate.date;
parameters.ParamByName('idcard').Value:=trim(viewform.zz_idcard.Text);
parameters.ParamByName('zhh').Value:=trim(viewform.zz_zhh.Text);
parameters.ParamByName('dw').value:=dw;
parameters.ParamByName('jnpay').Value:=viewform.zz_jnpay.Value;
parameters.ParamByName('gwpay').Value:=viewform.zz_gwpay.Value;
parameters.ParamByName('eachbt').value:=viewform.zz_eachbt.Value;
parameters.ParamByName('gsbt').Value:=viewform.zz_gsbt.Value;
parameters.ParamByName('gzbt').Value:=viewform.zz_gzbt.Value;
parameters.ParamByName('ylbt').value:=viewform.zz_ylbt.Value;
parameters.ParamByName('ylj').Value:=viewform.zz_ylj.Value;
parameters.ParamByName('gjj').Value:=viewform.zz_gjj.Value;
parameters.ParamByName('syj').value:=viewform.zz_syj.Value;
execute;
end;
mainform.zzquy.EnableControls;
end;
试一下