开心六月综合激情婷婷|欧美精品成人动漫二区|国产中文字幕综合色|亚洲人在线成视频

    1. 
      
        <b id="zqfy3"><legend id="zqfy3"><fieldset id="zqfy3"></fieldset></legend></b>
          <ul id="zqfy3"></ul>
          <blockquote id="zqfy3"><strong id="zqfy3"><dfn id="zqfy3"></dfn></strong></blockquote>
          <blockquote id="zqfy3"><legend id="zqfy3"></legend></blockquote>
          打開APP
          userphoto
          未登錄

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

          開通VIP
          Delphi連接mysql數(shù)據(jù)庫的三種方式

          (1)通過ODBC+ADO的方式連:

              with ADOCon1 do

              begin 
                Close;
                ConnectionString:=( 'DRIVER={MySQL ODBC 5.1 Driver}; '+
                                            'SERVER=192.168.1.107; '+
                                            'DATABASE=test; '+
                                            'USER=root; '+
                                            'PASSWORD=root; '+
                                            'PORT=3406; '+
                                            'OPTION=3; ');
                try

                  Open;
                  application.MessageBox( '連接成功!', '提示 ',MB_ICONINFORMATION);

                except
                  application.MessageBox( '無法連接數(shù)據(jù)庫服務(wù)器.請(qǐng)與管理員聯(lián)系 ', '提示 ',MB_ICONINFORMATION);
                end;  //try

             end;  //with

           

          (2)通過DBExpress連:

            SQLConnection1.Connected:= false;
           
            with SQLConnection1.Params do
            begin
              Text:='DriverName=MSSQL'+#13+
                'ServerPort=' + 3406 + #13+
                'HostName=' + '192.168.1.107'+ #13+
                'DataBase= test' +#13+
                'User_Name=root'+#13+
                'Password=root'+#13+
                'BlobSize=-1'+#13+
                'ErrorResourceFile='+#13+
                'LocaleCode=0000'+#13+
                'ServerCharset=gb2312'+#13+
                'MSSQL   TransIsolation=ReadCommited'+ #13+
                'OS   Authentication=False';
            end;
            try
              SQLConnection1.Connected:=true;

              application.MessageBox( '連接成功!', '提示 ',MB_ICONINFORMATION);
            except
               application.MessageBox( '無法連接數(shù)據(jù)庫服務(wù)器.請(qǐng)與管理員聯(lián)系 ', '提示 ',MB_ICONINFORMATION);  

            end;

          注:在delphi7及以下版本,ServerPort設(shè)置無效

           

          (3)通過MyDAC連:

            with ADOCon1 do
            begin
              Close;

              Server:= '192.168.1.107';
              Port:= 3406;
              Username:= 'root';
              Password:= 'root';
              Database:= 'test';
              Options.Charset:= 'gb2312';

              try
                Open();

                application.MessageBox( '連接成功!', '提示 ',MB_ICONINFORMATION);

              except
                application.MessageBox( '無法連接數(shù)據(jù)庫服務(wù)器.請(qǐng)與管理員聯(lián)系 ', '提示 ',MB_ICONINFORMATION);
              end;  //try
            end;   //with

          本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)
          打開APP,閱讀全文并永久保存 查看更多類似文章
          猜你喜歡
          類似文章
          delphi操作sql數(shù)據(jù)庫的備份和強(qiáng)制還原
          MySQL5.5.19安裝圖解
          MySQL5.6與MySQL5.7安裝的區(qū)別
          Ubuntu: Install and configure a MySQL server
          Delphi顯示確認(rèn)框
          一.MySQL入門基礎(chǔ)
          更多類似文章 >>
          生活服務(wù)
          分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
          綁定賬號(hào)成功
          后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
          如果VIP功能使用有故障,
          可點(diǎn)擊這里聯(lián)系客服!

          聯(lián)系客服