Board index » delphi » Connect MS SQL Server via TCP/IP

Connect MS SQL Server via TCP/IP

When I install MS SQL 6.5, I always install TCP/IP Protocol.  And when
installation finished, it will tell me that 'SQL Server Will Listen on the
Following TCP/IP Port Number: 1433'.

Does it mean that I can write a program to connect to MS SQL Server via
TCP/IP?  Using Delphi (and data-aware component), is it possible to do so?

Ajax.

 

Re:Connect MS SQL Server via TCP/IP


Yes, you can. All you have to do is to install the MS SQL client on our
client computer and set it to use TCP/IP. You will of course have to use
Delphi Client/Server versions as it is only in this that you will find the
MS SQL drivers for the BDE (SQL Links). OR you can use our SQLQuery
component that is a TDataset that does not need the BDE and is optimized to
work with SQL Server.

--
Thomas Werner

{*  SQLQuery - TDataset vcl for direct access to MS SQL Server *}
{*  Component Store Ltd.   http://component-store.com               *}
{***************************************************************************
*}

aj skrev i meddelandet <6r6d6j$g...@forums.borland.com>...

Quote
>When I install MS SQL 6.5, I always install TCP/IP Protocol.  And when
>installation finished, it will tell me that 'SQL Server Will Listen on the
>Following TCP/IP Port Number: 1433'.

>Does it mean that I can write a program to connect to MS SQL Server via
>TCP/IP?  Using Delphi (and data-aware component), is it possible to do so?

>Ajax.

Re:Connect MS SQL Server via TCP/IP


Quote
In article <6r6jgr$gi...@forums.borland.com>, "Thomas Werner" <tho...@adatasys.com> wrote:
>Yes, you can. All you have to do is to install the MS SQL client on our
>client computer and set it to use TCP/IP. You will of course have to use
>Delphi Client/Server versions as it is only in this that you will find the
>MS SQL drivers for the BDE (SQL Links). OR you can use our SQLQuery
>component that is a TDataset that does not need the BDE and is optimized to
>work with SQL Server.
>{*  SQLQuery - TDataset vcl for direct access to MS SQL Server *}
>{*  Component Store Ltd.   http://component-store.com               *}
>{***************************************************************************

If you are using MS SQL with Delphi, it would be wise to try out Thomas's
components.  They are quite good.

[* k...@kylecordes.com       | For Delphi  |  BDE Alternatives Guide  *]
[* http://www.kylecordes.com | developers: | MIDAS Alternatives Guide *]

Re:Connect MS SQL Server via TCP/IP


Dear Thomas:

Only a little I don't understand, if I don't want to install the MS SQL
client to client computer, cann't I set it to use TCP/IP?

For example, after finishing my program of MS SQL Client, I just copy
NTWDBLIB.DLL to user's computer by using installshield, then All work.  I
never install any MS SQL client portion to user's computer.

In this case, is it possible to connect my application to MS SQL Server via
TCP/IP?

(if there is any wrong conception, you can correct me!)

Thomas Werner ???g??31 <6r6jgr$gi...@forums.borland.com>...

Quote
>Yes, you can. All you have to do is to install the MS SQL client on our
>client computer and set it to use TCP/IP. You will of course have to use
>Delphi Client/Server versions as it is only in this that you will find the
>MS SQL drivers for the BDE (SQL Links). OR you can use our SQLQuery
>component that is a TDataset that does not need the BDE and is optimized to
>work with SQL Server.

>--
>Thomas Werner

>{*  SQLQuery - TDataset vcl for direct access to MS SQL Server *}
>{*  Component Store Ltd.   http://component-store.com               *}
>{**************************************************************************
*
>*}

>aj skrev i meddelandet <6r6d6j$g...@forums.borland.com>...
>>When I install MS SQL 6.5, I always install TCP/IP Protocol.  And when
>>installation finished, it will tell me that 'SQL Server Will Listen on the
>>Following TCP/IP Port Number: 1433'.

>>Does it mean that I can write a program to connect to MS SQL Server via
>>TCP/IP?  Using Delphi (and data-aware component), is it possible to do so?

>>Ajax.

Re:Connect MS SQL Server via TCP/IP


Quote
In article <6r85fi$j...@forums.borland.com>, "aj" <clo...@sun1.mis.nsysu.edu.tw> wrote:
>Dear Thomas:

>Only a little I don't understand, if I don't want to install the MS SQL
>client to client computer, cann't I set it to use TCP/IP?

>For example, after finishing my program of MS SQL Client, I just copy
>NTWDBLIB.DLL to user's computer by using installshield, then All work.  I
>never install any MS SQL client portion to user's computer.

>In this case, is it possible to connect my application to MS SQL Server via
>TCP/IP?

Correct.  To install the SQL Client, you copy NTWDBLIB.DLL and another DLL
(depending on the protocol you are using) to the windows\system directory,
then set a few registry settings.  The installation is explained in the SQL
Server Books Online.  (Setting up NTWDBLIB is not specifc  to Thomas's
product.)

[* k...@kylecordes.com       | For Delphi  |  BDE Alternatives Guide  *]
[* http://www.kylecordes.com | developers: | MIDAS Alternatives Guide *]

Re:Connect MS SQL Server via TCP/IP


So what I should do now is to read 'SQL Server Books Online'.  O.K. I will
do it, thank you for helping.  Hope you still give me hints if i just cann't
understand when reading 'SQL Server Books Online'.

Ajax.

Kyle Cordes ???g??31 <6r98ko$k...@forums.borland.com>...

Quote
>In article <6r85fi$j...@forums.borland.com>, "aj"
<clo...@sun1.mis.nsysu.edu.tw> wrote:

>>Dear Thomas:

>>Only a little I don't understand, if I don't want to install the MS SQL
>>client to client computer, cann't I set it to use TCP/IP?

>>For example, after finishing my program of MS SQL Client, I just copy
>>NTWDBLIB.DLL to user's computer by using installshield, then All work.  I
>>never install any MS SQL client portion to user's computer.

>>In this case, is it possible to connect my application to MS SQL Server
via
>>TCP/IP?

>Correct.  To install the SQL Client, you copy NTWDBLIB.DLL and another DLL
>(depending on the protocol you are using) to the windows\system directory,
>then set a few registry settings.  The installation is explained in the SQL
>Server Books Online.  (Setting up NTWDBLIB is not specifc  to Thomas's
>product.)

>[* k...@kylecordes.com       | For Delphi  |  BDE Alternatives Guide  *]
>[* http://www.kylecordes.com | developers: | MIDAS Alternatives Guide *]

Re:Connect MS SQL Server via TCP/IP


I just check the document of Inprise, and I find the following data.  I
think this infomation is what I need.

I post here for others who have the same question of mime:

=========================================================================

32bit MS SQL Client software
(one source of this install is the MS SQL Server 6.x CD)
DBLIB NTWDBLIB.DLL v6.00.121NETLIB DBNSSPXN.DLL spx DBNMPNTW.DLL named pipes
 DBMSRPCN.DLL multiprotocol DBMSSOCN.DLL windows sockets
WINDBVER.EXE to set individual server names, net protocols,
 search for files, etc.\bin\binn\dll\install\sqlole
Example of relevent registry entries:
(the following is just an example. The entries below are the result
of a successful MS client software install and configuration)
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client\ConnectTo]
"DSQUERY"="DBMSRPCN"@="dbmssocn.dll""mssql60"="dbmssocn,mssql60"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client\PrefServers]
@="mssql60,""0"="mssql60,delphi1"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client\DB-Lib]
"AutoAnsiToOem"="on""UseIntlSettings"="ON"

Re:Connect MS SQL Server via TCP/IP


Actually you usually can get by without having to modify the registry. If
your registry is "clean" the DBLIB library NTWDBLIB will try to establish
connection with the SQL Server using the named pipes driver DBNMPNTW.DLL.
This works of course also when you run TCP/IP as network protocoll as named
pipes can be run over this. So by just copying these two dll:s to your
[system] directory you will be able to connect to SQL Server.

Thomas Werner

{*  SQLQuery - TDataset vcl for direct access to MS SQL Server *}
{*  Component Store Ltd.   http://component-store.com               *}
{***************************************************************************
*}

aj skrev i meddelandet <6rb9cj$n...@forums.borland.com>...

Quote
>I just check the document of Inprise, and I find the following data.  I
>think this infomation is what I need.

>I post here for others who have the same question of mime:

>=========================================================================

>32bit MS SQL Client software
>(one source of this install is the MS SQL Server 6.x CD)
>DBLIB NTWDBLIB.DLL v6.00.121NETLIB DBNSSPXN.DLL spx DBNMPNTW.DLL named
pipes
> DBMSRPCN.DLL multiprotocol DBMSSOCN.DLL windows sockets
>WINDBVER.EXE to set individual server names, net protocols,
> search for files, etc.\bin\binn\dll\install\sqlole
>Example of relevent registry entries:
>(the following is just an example. The entries below are the result
>of a successful MS client software install and configuration)
>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer]
>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client]
>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client\ConnectTo]
>"DSQUERY"="DBMSRPCN"@="dbmssocn.dll""mssql60"="dbmssocn,mssql60"
>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client\PrefServers]
>@="mssql60,""0"="mssql60,delphi1"
>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client\DB-Lib]
>"AutoAnsiToOem"="on""UseIntlSettings"="ON"

Other Threads