Newsgroup: it.comp.lang.visual-basic
Titolo: [?] Connessione ADO a SQL 7.0 via TCP/IP

Salve,
sapete come si può specificare direttamente nella stringa di connessione ADO
il fatto di voler utilizzare TCP/IP invece di named pipes?
Fin'ora io ho dovuto fare un' ODBC fittizzio dove imposto TCP/IP invece di
named pipes, cosi tutte le connessioni utilizzano tcp/ip.
Si può evitare?
Grazie
--
Enrico Oemi,
Info.Mont. S.p.A.
via Nazionale 102
43043 Borgo Val di Taro (PR)

cito da Msdn:
(ciao
ugo)
HOWTO: Set the SQL Server Network Library in an ADO Connection String
----------------------------------------------------------------------------
----
The information in this article applies to:
Microsoft Data Access Components versions 1.5, 2.0, 2.1, 2.1 (GA), 2.1 SP1,
2.1 SP2, 2.5
----------------------------------------------------------------------------
----
SUMMARY
SQL Server allows you to choose from a number of different network libraries
that you can use when connecting. You can configure these network libraries
when you create a data source name (DSN) for your data source. However, an
alternative way to specify the DSN is to pass in the network library, which
you want to use, with the connection string. This article describes how to
specify the network library that you want to use for connecting to SQL
Server when connecting from a Visual Basic application that uses ActiveX
Data Objects (ADO).
MORE INFORMATION
SQL Server allows you to use the following network libraries when
establishing a connection. They are:
dbnmpntw - Win32 Named Pipes
dbmssocn - Win32 Winsock TCP/IP
dbmsspxn - Win32 SPX/IPX
dbmsvinn - Win32 Banyan Vines
dbmsrpcn - Win32 Multi-Protocol (Windows RPC)
When connecting to SQL Server through ADO the NETWORK parameter in the
connection string can be used to specify which of these libraries to use
when connecting to the database. The NETWORK parameter is the name of the
Net-Library module to use, without the .dll suffix (for example, Dbmssocn,
not Dbmssocn.dll). Here are some examples of connection strings that specify
this parameter:
The connection string:
"Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial
Catalog=pubs;Data Source=YourDataSourceName;Network Library=dbnmpntw"
attempts to connect to SQL Server through the SQLOLEDB provider using the
Named Pipes network library.
The connection string:
"Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Extended
Properties="DSN=yourdatasourcename;UID=sa;DATABASE=pubs;Network=dbmssocn";In
itial Catalog=pubs"
connects to SQL Server through the MSDASQL provider using the TCP/IP network
library.
REFERENCES
For more information, see the following articles in the Microsoft Knowledge
Base:
Q137635 INF: ODBC SQL Server Connection Parameters
Q137634 INF: Reading ODBC SQL Server Driver Network Messages
Additional query words:
Keywords : kbADO kbMDAC kbSQLServ kbGrpVBDB kbDSupport kbADO210sp2 kbMDAC250
Version : WINDOWS:1.5,2.0,2.1,2.1 (GA),2.1 SP1,2.1 SP2,2.5
Platform : WINDOWS
Issue type : kbhowto
Technology :
Last Reviewed: March 1, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.
----------------------------------------------------------------------------
----
Send feedback to MSDN.Look here for MSDN Online resources.