ADO 连SQL Server时候connectionString属性的完整写法
到底要写那些参数看了好多地方都不一样

解决方案 »

  1.   

    Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=master;Data Source=SERVER;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=SERVER;Use Encryption for Data=False;Tag with column collation when possible=False
      

  2.   

    procedure Tform1.FormCreate(Sender: TObject);
    begin
     adoconnection1.ConnectionString:=
     'Provider=SQLOLEDB.1;Password=密碼;Persist Security Info=True;User ID=用戶名;Initial      Catalog=數據庫名;Data Source=服務器名稱';
     adoconnection1.LoginPrompt:=false;
     adoconnection1.Connected:=true;
    end;