Page 1 of 1

can't connect sql server if the port is't 1433

Posted: Tue 29 Mar 2011 10:57
by bugmenot1
if the SQL Server's port isn't 1433.

the code didn't connected

Code: Select all

 with UniConnection1 do
    begin
      Connected := False;
       database:=ServerDB;
       Username:=ServerUser;
        port:=ServerPort;
        Password:=ServerPass;
        Server:=ServerIP;
      Connected := True;
    end;
but this code is ok

Code: Select all

 with UniConnection1 do
    begin
      Connected := False;
       database:=ServerDB;
       Username:=ServerUser;
//        port:=ServerPort;
        Password:=ServerPass;
        Server:=ServerIP+','+ServerPort;
      Connected := True;
    end;

Posted: Tue 29 Mar 2011 14:16
by AndreyZ
Hello,

It's a correct UniDAC behaviour. It's needed for maintaining compatibility with SDAC that doesn't have the Port property. To use specific port for SQL Server, you should set the TUniConnection.Server property in the following way:

Code: Select all

UniConnection.Server := 'host,port';