全部的分值都给你,只要你能帮我解决问题!! 关于delphi对access操作的
我这段代码的主要作用是: 把stringgrid的数据存入已知表! stringgrid中的某些字段,我需要从另外一个表里读出另外的一个字段替换掉! 这段代码在DLL中实现,是一个按钮的click事件中写的!
sql.Add('insert into stainfo(stano,sname,sex,depid,sorts)'+
'values(:InpStano,:InpSname,:InpSex,[SELECT dept.id FROM dept WHERE (((dept.dep)=:InpDep))],[SELECT dept.id FROM dept WHERE (((dept.sorts)=:InpSorts))]');
Parameters.ParamByName('InpStano').Value:=strgrinport.Cells[1,i];
Parameters.ParamByName('InpSname').Value:=StrGrInport.Cells[2,i];
Parameters.ParamByName('InpSex').Value:=StrGrInport.Cells[3,i];
InpDep:=StrGrInport.Cells[8,i]; //要读取其他表获得
InpSorts:=StrGrInport.Cells[9,i]; //要读取其他表获得
编译没有任何错误,但是运行的时候,提示 ''不是有效值,估计是参数传递的时候,值没有传递出来,为什么这样,该如何解决,谢谢大家,给个指引!!!