亚洲激情专区-91九色丨porny丨老师-久久久久久久女国产乱让韩-国产精品午夜小视频观看

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

Delphi動態鏈接多個數據源執行操作例子

發布時間:2020-07-25 05:49:20 來源:網絡 閱讀:491 作者:sunboy_zzc 欄目:開發技術

1.首先配置文件
[SubExamDep1]
DBSERVER=(local)
DBNAME=herpeisweixin
USERNAME=sa
PWD=bjbr
MSG=SubExamDep1失敗
[SubExamDep2]
DBSERVER=(local)
DBNAME=herpeisFZTJ
USERNAME=sa
PWD=bjbr
MSG=SubExamDep2失敗
2.工程文件加入 Inifiles 文件
public:
MyIni :Tinifile;
glAppPath :string;
create 事件增加
glAppPath := ExtractFilePath(Application.ExeName);//獲取當前運行程序的路徑
MyIni := Tinifile.Create(glAppPath + 'SubDBConfig.ini');

初始化表單增加
with spSP_SyncOrg do
begin

  ProcedureName:='P_SYNCORGINF';
  Parameters.CreateParameter('@ID_Org', ftInteger, pdInput, 0,null );
  Parameters.CreateParameter('@ID_OrgReservation', ftInteger, pdInput, 0, null);
  Parameters.CreateParameter('@RetMsg',ftString,pdOutput,50,null)
end;

    實現按鈕事件
    procedure TFormPeisOrgReservation.btn_IssuedSubClick(Sender: TObject);

var
i:Integer;
DBSERVER,DBNAME,USERNAME,PWD:string;
CurSecetion:string;
CURID_ORG,CURID_OrgReservation :Integer;
MSG,retMSG,SumMsg:string;
sucessnum:Integer;

begin
MSG:='';
retMSG:='';
SumMsg:='';

if not aqMain1.Active then
begin
  Exit;
end;
lst1.Clear;
CURID_ORG:=aqMain1.fieldbyname('ID_Org').Value;
CURID_OrgReservation:=aqMain1.fieldbyname('ID_OrgReservation').Value;
sucessnum:=0;
MyIni.ReadSections(lst1.Items);
for i:=0 to lst1.Count-1 do
begin
  CurSecetion:=lst1.Items[i];
  DBSERVER:=MyIni.ReadString(CurSecetion,'DBSERVER','');
  DBNAME:=MyIni.ReadString(CurSecetion,'DBNAME','');
  USERNAME:=MyIni.ReadString(CurSecetion,'USERNAME','');
  PWD:=MyIni.ReadString(CurSecetion,'PWD','');
  MSG:=MyIni.ReadString(CurSecetion,'MSG','');

   try
      ADOConnection1SUB.Connected:=False;
      ADOConnection1SUB.ConnectionString:='Provider=SQLOLEDB.1;Password='+PWD+';Persist Security Info=True;User ID='+USERNAME+';Initial Catalog='+DBNAME+';Data Source='+DBSERVER;
      ADOConnection1SUB.Connected:=True;
      spSP_SyncOrg.Parameters.ParamByName('@ID_ORG').Value:=CURID_ORG;
      spSP_SyncOrg.Parameters.ParamByName('@ID_OrgReservation').Value:=CURID_OrgReservation;
      spSP_SyncOrg.ExecProc;
      retMSG:=spSP_SyncOrg.Parameters.ParamByName('@RetMsg').Value;

      if retMSG='同步成功!' then
      begin
          sucessnum:=sucessnum+1;
      end;

      if retMSG='同步失敗!' then
      begin
         if SumMsg='' then
         begin
            SumMsg:=MSG;
         end
         else
         begin
            SumMsg:=SumMsg+','+MSG;
         end;

      end;

   except
   end;

end;
if sucessnum=lst1.Count then
begin
   ShowMessage('同步成功!');
end
else
begin
   if SumMsg='' then
   begin
      ShowMessage('執行失敗!');
   end
   else
   begin
      ShowMessage(SumMsg);
   end;
end;

end;

界面放一個adoconnection和listbox控件

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

南和县| 乐亭县| 洛浦县| 子长县| 安达市| 铜梁县| 青州市| 莒南县| 安福县| 徐州市| 突泉县| 铅山县| 平远县| 阿克陶县| 洛浦县| 天祝| 大兴区| 博客| 诸城市| 交城县| 沾化县| 疏附县| 博客| 涪陵区| 禄丰县| 灵丘县| 马鞍山市| 兴宁市| 长宁县| 贵阳市| 荔波县| 城口县| 诸暨市| 乌兰察布市| 平遥县| 张家川| 浙江省| 布尔津县| 沙田区| 龙陵县| 东山县|