How to define a connection port.

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Guest

How to define a connection port.

Post by Guest » Mon 21 Feb 2005 02:09

Can anyone tell me how to define the SQL port to use to communication to the server?

On a system that has the default ODBC settings defined with a dynamic port are able to connect to the SQL Server. If I go into the ODBC connection manager, and start to create a connection, change the port from dynamic to 1433. Exit or close the ODBC manager and then open my application it works.

If I do not do this step I am unable to locate the SQL Server?

Any ideas?

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Mon 21 Feb 2005 10:16

You can use Client Network Utility (included into MS SQL Server package), or make corresponding changes in the registry directly (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client\ConnectTo)

Guest

Defining a connection port

Post by Guest » Mon 21 Feb 2005 14:45

Is it possible to define the connection details in Delphi, and not use the registry values?

Does the SDAC sit on top of the ODBC/OLE DB drivers and therefore use the current system configurations?

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Tue 22 Feb 2005 12:11

>> Is it possible to define the connection details in Delphi, and not use the
> registry values?

Not, as Microsoft didn't document a possibility to transfer port number in OLE DB.


> Does the SDAC sit on top of the ODBC/OLE DB drivers and therefore use the
> current system configurations?

SDAC doesn't use ODBC. SDAC uses the most low-level way to access to MS SQL Server
through OLE DB. But, a number of the port isn't available at this level either.

MoRpH
Posts: 1
Joined: Tue 07 Feb 2006 17:38
Location: Guatemala

defining a connection port

Post by MoRpH » Tue 07 Feb 2006 17:42

the only thing that you have to do is:
in the connection string add the port just like this:
example:
200.35.157.11,2222
separate this with a coma.
that's it.
have fun :D

Post Reply