3
3368aa
Unregistered / Unconfirmed
GUEST, unregistred user!
可感觉到执行这条SQL了,但就是找不到数据??
大家帮忙呀!!
procedure getdwID(bm,dw:string;geter:string);
var
quy:TADOQuery;
begin
quy:=mainform.selquy;
if quy.Active then quy.Close;
mainform.selquy.SQL.Clear;
quy.SQL.Add('select dw_id from dw where (bm=:bm and dw=:dw)');
quy.Parameters.ParamByName('bm').Value:=bm;
quy.Parameters.ParamByName('dw').Value:=dw;
mainform.selquy.open;
if quy.RecordCount>0 then
geter:=quy.Fields.Fields[0].AsString
else
geter:='';
end;
procedure zzadd;
var
addsql:widestring;
dw:string;
begin
viewunit.getdwID (trim(viewform.zz_bm.Text),trim(viewform.zz_dw.Text),dw);
addsql:='insert zz(name,sex,mz,born,jobdate,dw,IDCard,zhh,jnpay,gwpay,eachbt,gsbt,gzbt,ylbt,ylj,gjj,syj)'
+' values ('
+''''+ viewform.zz_name.text+''''
+','''+ viewform.zz_sex.text+''''
+','''+ viewform.zz_mz.text+''''
+','''+ datetimetostr(viewform.zz_born.date)+''''
+','''+ datetimetostr(viewform.zz_jobdate.date)+''''
+','''+ dw+''''
+','''+ viewform.zz_idcard.text+''''
+','''+ viewform.zz_zhh.text+''''
+','+ floattostr(viewform.zz_jnpay.Value)
+','+ floattostr(viewform.zz_gwpay.Value)
+','+ floattostr(viewform.zz_eachbt.Value)
+','+ floattostr(viewform.zz_gsbt.Value)
+','+ floattostr(viewform.zz_gzbt.Value)
+','+ floattostr(viewform.zz_ylbt.Value)
+','+ floattostr(viewform.zz_ylj.Value)
+','+ floattostr(viewform.zz_gjj.Value)
+','+ floattostr(viewform.zz_syj.Value)
+')';
with viewform.ADOCommand1 do
begin
// Cancel;
CommandType:=cmdtext;
CommandText:=addsql;
Execute;
end; // with
mainform.zzquy.Refresh;
end;
所有数据都正确,但就是在数据库中看不到这行数据????
大家帮忙呀!!
procedure getdwID(bm,dw:string;geter:string);
var
quy:TADOQuery;
begin
quy:=mainform.selquy;
if quy.Active then quy.Close;
mainform.selquy.SQL.Clear;
quy.SQL.Add('select dw_id from dw where (bm=:bm and dw=:dw)');
quy.Parameters.ParamByName('bm').Value:=bm;
quy.Parameters.ParamByName('dw').Value:=dw;
mainform.selquy.open;
if quy.RecordCount>0 then
geter:=quy.Fields.Fields[0].AsString
else
geter:='';
end;
procedure zzadd;
var
addsql:widestring;
dw:string;
begin
viewunit.getdwID (trim(viewform.zz_bm.Text),trim(viewform.zz_dw.Text),dw);
addsql:='insert zz(name,sex,mz,born,jobdate,dw,IDCard,zhh,jnpay,gwpay,eachbt,gsbt,gzbt,ylbt,ylj,gjj,syj)'
+' values ('
+''''+ viewform.zz_name.text+''''
+','''+ viewform.zz_sex.text+''''
+','''+ viewform.zz_mz.text+''''
+','''+ datetimetostr(viewform.zz_born.date)+''''
+','''+ datetimetostr(viewform.zz_jobdate.date)+''''
+','''+ dw+''''
+','''+ viewform.zz_idcard.text+''''
+','''+ viewform.zz_zhh.text+''''
+','+ floattostr(viewform.zz_jnpay.Value)
+','+ floattostr(viewform.zz_gwpay.Value)
+','+ floattostr(viewform.zz_eachbt.Value)
+','+ floattostr(viewform.zz_gsbt.Value)
+','+ floattostr(viewform.zz_gzbt.Value)
+','+ floattostr(viewform.zz_ylbt.Value)
+','+ floattostr(viewform.zz_ylj.Value)
+','+ floattostr(viewform.zz_gjj.Value)
+','+ floattostr(viewform.zz_syj.Value)
+')';
with viewform.ADOCommand1 do
begin
// Cancel;
CommandType:=cmdtext;
CommandText:=addsql;
Execute;
end; // with
mainform.zzquy.Refresh;
end;
所有数据都正确,但就是在数据库中看不到这行数据????