A
andywos
Unregistered / Unconfirmed
GUEST, unregistred user!
给朋友做了一个根据图片名导入图片工具,出现问题,急急,在线等每次运行你选了5000个图片,只能导入1900多个文件成功,文件名与对应的记录没错。不知是哪有限制,谢谢高手指点一下。每次只导1000个图片正常试着把STR2 改居ANSISTRING也是一样;procedure TForm1.ToolButton1Click(Sender: TObject);var picstream:tadoblobstream; i:integer; str2:String; j,count1:integer; begin if OpenDialog1.Execute then begin listbox1.Items.Clear; count1:=0; // path:=opendialog1.FileName; for i:=0 to opendialog1.Files.Count-1 do begin// 不带扩展名文件名 j:= pos('.',extractfilename(OpenDialog1.Files)); str2:=copy (extractfilename(OpenDialog1.Files),1,j-1); // showmessage(STR2); adoquery1.Close; adoquery1.SQL.Clear; adoquery1.SQL.Add('select * from prdt_pic where prd_no='+''''+str2+''''); adoquery1.Open; if adoquery1.RecordCount=1 then begin //流文件 adoquery1.edit; picstream:=tadoblobstream.Create(tblobfield(adoquery1.fields[1]),bmWrite); picstream.LoadFromFile(opendialog1.Files); picstream.Position:=0; // adoquery1.edit; tblobfield(adoquery1.Fields[1]).loadfromstream(picstream); adoquery1.post; ListBox1.ITems.Add(OpenDialog1.Files.Strings); count1:=count1+1 end; end; showmessage('你已载入图片'+inttostr(count1)+'张'); //更新计算 end;