Y
ychy
Unregistered / Unconfirmed
GUEST, unregistred user!
我现在只能一条一条地insert,效率太低,我用sql.add(..)不断地增加,到最后再来execsql,
但报错:参数不行,请问大家该怎么办?
while not Eof(f) do
begin
if (Terminated) then
exit;
try
Readln(F,FileItem);
AnalyzeDir(FileItem);
except
exit;
end;
try
with ADOQuery do
begin
close;
sql.Clear ;
sql.Add('insert into allml(bj,bfbj,ip,name,fullname,fenlei,leixin,time)'
+'values bj,:bfbj,:ip,:sname,:fullpath,:fenlei,:leixin,:time)');
prepared:=true;
Parameters.ParamByName('bj').Value :=bj;
Parameters.ParamByName('bfbj').Value :=bfbj;
Parameters.ParamByName('ip').Value :=ip;
Parameters.ParamByName('sname').Value :=sname;
Parameters.ParamByName('fullpath').Value :=fullpath;
Parameters.ParamByName('fenlei').Value :=fenlei;
Parameters.ParamByName('time').Value :=time;
ExecSQL ;
但报错:参数不行,请问大家该怎么办?
while not Eof(f) do
begin
if (Terminated) then
exit;
try
Readln(F,FileItem);
AnalyzeDir(FileItem);
except
exit;
end;
try
with ADOQuery do
begin
close;
sql.Clear ;
sql.Add('insert into allml(bj,bfbj,ip,name,fullname,fenlei,leixin,time)'
+'values bj,:bfbj,:ip,:sname,:fullpath,:fenlei,:leixin,:time)');
prepared:=true;
Parameters.ParamByName('bj').Value :=bj;
Parameters.ParamByName('bfbj').Value :=bfbj;
Parameters.ParamByName('ip').Value :=ip;
Parameters.ParamByName('sname').Value :=sname;
Parameters.ParamByName('fullpath').Value :=fullpath;
Parameters.ParamByName('fenlei').Value :=fenlei;
Parameters.ParamByName('time').Value :=time;
ExecSQL ;