用这种试试,写数据库代码如下:
with query1 do
begin
sSQL:=
'insert into Createdreport '+
'(setid,year,id,title,eid,enterprisename,month,contain,'+
' userid,username,inputdate) '+
' values
SetID,:Year,:Id,:title,:eid,:enterprisename,'+
' :month,:contain,:userid,:username,:inputdate)';
SQL.Text :=sSQL;
ParamByName('SetID').AsString := IntToStr(mSetID);
ParamByName('Year').AsString := IntToStr(mYear);
ParamByName('ID').AsString:='1000';
ParamByName('Title').AsString:='';
ParamByName('EID').AsString:=mEID;
ParamByName('EnterpriseName').AsString:=mEName;
ParamByName('Month').AsString:='1';//m_Month;
ParamByName('UserID').AsString:=mUserID;
ParamByName('UserName').AsString:=mUserName;
ParamByName('InputDate').AsDateTime:=Now();
ParamByName('Contain').LoadFromFile('数据库文件.CLL',ftBlob);
ExecSQL;