免费视频淫片aa毛片_日韩高清在线亚洲专区vr_日韩大片免费观看视频播放_亚洲欧美国产精品完整版

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費(fèi)電子書(shū)等14項(xiàng)超值服

開(kāi)通VIP
Excel導(dǎo)出。PageControl - Delphi / VCL組件開(kāi)發(fā)及應(yīng)用
procedure TRES_DCC_ECRN_F.cxButton1Click(Sender: TObject);
var
  ExcelApp,WorkBook:Olevariant;
  ExcelSheetCount,i,k:Integer;
begin
  inherited;
 
if RzButtonEdit1.Text <>'' then
 
begin
   
if (ExtractFileExt(RzButtonEdit1.Text)<>'.xls')   then
   
begin
      MessageDlg(
'請(qǐng)選擇要導(dǎo)入的Excel檔案!',mtWarning,[mbOK],0);
      RzButtonEdit1.Clear;
   
end
   
else
   
begintry Application.ProcessMessages;ExcelApp:=CreateOleObject('Excel.Application');
        WorkBook:
=ExcelApp.WorkBooks.Open(RzButtonEdit1.Text);
        ExcelApp.Visible:
=False;
        ExcelSheetCount:
=WorkBook.WorkSheets.Count;
       
for i:=1 to ExcelSheetCount  do
       
begin
          Screen.Cursor:
=crSQLWait;
          WorkBook.WorkSheets[i].Activate;
          a:
=ExcelApp.Cells[4,2].Value;
          b:
=ExcelApp.Cells[8,2].Value;
          c:
=ExcelApp.Cells[14,2].Value;
          d:
=ExcelApp.Cells[21,2].Value;
          e:
=ExcelApp.Cells[22,2].Value;
          f:
=ExcelApp.Cells[23,2].Value;
         
if ((Copy(Trim(a),1,3)<>'ECR') and (b<>'')) and ((Copy(Trim(a),1,3)<>'DCR') and (b<>'')) then
         
begin
            MessageDlg(
'檔案格式錯(cuò)誤!',mtWarning,[mbOK],0);
            InsertErrorLOG;
            Screen.Cursor:
=crDefault;
            Exit;
         
end;

         
with adoq_ecrn do
         
begin
            Close;
            SQL.Text:
='select * from RES_ECR_TYPE where ECRNO='''+ a+'''';
            Open;
           
if RecordCount=1 then
           
begin
              MessageDlg(
'請(qǐng)檢查:導(dǎo)入檔案時(shí)編號(hào)"'+ a+'"的記錄重復(fù)!',mtWarning,[mbOK],0);
              InsertRepeatLOG;
              Screen.Cursor:
=crDefault;
              Exit;
           
end;
         
end;

          
with adoq_ecrn do
          
begin
             Close;
             SQL.Clear;
             SQL.Add(
'insert into RES_ECR_TYPE(ECRNO,DESOFCHANGE,RELEASEDATE,RESPEOPLE,ISSUEDEPT,MODEL) values(:a,:b,:c,:d,:e,:f)');
             Parameters.ParamByName(
'a').Value:=a;
             Parameters.ParamByName(
'b').Value:=b;
             Parameters.ParamByName(
'c').Value:=Trim(Copy(c,1,19));
             Parameters.ParamByName(
'd').Value:=d;
             Parameters.ParamByName(
'e').Value:=e;
             Parameters.ParamByName(
'f').Value:=f;
             ExecSQL;
          
end;
           InsertECRLOG;

           ProgressBar1.Min:
=0;
           ProgressBar1.Max:
=ExcelSheetCount;
          
for k:=33 to WorkBook.WorkSheets[i].usedrange.rows.count  do
          
begin
             g:
=ExcelApp.Cells[K,1].Value;
             q:
=ExcelApp.Cells[k,2].Value;
             w:
=ExcelApp.Cells[k,3].Value;
             v:
=ExcelApp.Cells[k,4].Value;
             r:
=ExcelApp.Cells[k,5].Value;
             t:
=ExcelApp.Cells[k,6].Value;
             y:
=ExcelApp.Cells[k,7].Value;
             u:
=ExcelApp.Cells[k,8].Value;
             o:
=ExcelApp.Cells[k,9].Value;
            
if (q<>'')and(w<>'') then
            
with adoq_item do
            
begin
               Close;
               SQL.Clear;
               SQL.Add(
'insert into RES_ECR_ITEM(GROUPID,ECRNO,ITEMNO,ITEMDESPTION,FZRELATION,CHANGETYPE,BEFORECHANGE,AFTERCHANGE,PROPOSE,REMARK) values(:g,:p,:q,:w,:v,:r,:t,:y,:u,:o)');
               Parameters.ParamByName(
'g').Value:=g;
               Parameters.ParamByName(
'p').Value:=a;
               Parameters.ParamByName(
'q').Value:=q;
               Parameters.ParamByName(
'w').Value:=w;
               Parameters.ParamByName(
'v').Value:=v;
               Parameters.ParamByName(
'r').Value:=r;
               Parameters.ParamByName(
't').Value:=t;
               Parameters.ParamByName(
'y').Value:=y;
               Parameters.ParamByName(
'u').Value:=u;
               Parameters.ParamByName(
'o').Value:=o;
               ExecSQL;
               ProgressBar1.Position:
=ProgressBar1.Position+1;
            
end;
          
end;
           Screen.Cursor:
=crDefault;
           Application.ProcessMessages;
           ProgressBar1.Position:
=0;
           RefreshECRN;
           RefreshGroupItem;
           SendToEmail;
           Zt:
=1;
        
end;
      finally
        ExcelApp.ActiveWorkBook.Saved:
=True;
        WorkBook.Close;
        ExcelApp.Quit;
     
end;
    
end;
 
end
 
else
 
begin
    MessageDlg(
'請(qǐng)選擇要導(dǎo)入的Excel檔案!',mtWarning,[mbOK],0);
    Exit;
 
end;
end;
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開(kāi)APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
導(dǎo)入excel數(shù)據(jù)
Delphi ADOStoredProc 存儲(chǔ)過(guò)程用法
C#(com組件)操作Excel讀寫(xiě)
『Delphi園地』-利用Excel內(nèi)置功能快速導(dǎo)出數(shù)據(jù)到Excel
A Very Easy to Use Excel XML Import
DELPHI如何調(diào)用存儲(chǔ)過(guò)程
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服