procedure Tfrmpict.BitBtn2Click(Sender: TObject);
var
dirlist:TStringList;
i:Integer;
begin
inherited;
if chk_road.Checked then
begin
dirlist:=TStringList.Create ;
dirlist.Clear;
try
GetAllFileName(DirectoryListBox1.Directory,dirlist);
if dirlist.Count>0 then
begin
Gauge1.MinValue :=0;
Gauge1.MaxValue:= dirlist.Count-1;
for i:=0 to dirlist.Count-1 do
begin
with ADOQuery1 do
begin
Insert;
Fields[0].AsString:=copy(dirlist.Strings[i],1,pos('.',dirlist.Strings[i])-1);
if imagesavetosql(ADOQuery1,dirlist.Strings[i] )=false then
begin
ShowMessage('匯入'+dirlist.Strings[i]+'.jpg圖片時出錯');
Abort;
end;
Post;
end; //with
Gauge1.AddProgress(1);
end; //for
end //if
else
ShowMessage('該目錄下不存在JPG型別圖片');
finally
dirlist.Free;
end;
end
else
ShowMessage('請執行路徑選取操作');
//Close;
end;
提示:[Error] PSInserT.pas(66): Undeclared identifier: 'GetAllFileName',要如何處理?
uj5u.com熱心網友回復:
你這段代碼,多半是云抄的,而且你應該沒抄全,少抄了一個函式GetAllFileName。uj5u.com熱心網友回復:
提示輸出已經說很明白了,未定義 GetAllFileName 函式,參考 GetAllFileName 對應單元就可以。貌似IDE沒有提供這個函式,所以應該是自定義的函式,如果是自定義函式,參考這個函式所在單元就可以。
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/208502.html
標籤:VCL組件開發及應用
