Creating a system dsn or file dsn 
Author Message
 Creating a system dsn or file dsn

Hi folks,

I have this piece of VB code in my installation which queries a database on
the target machine. Till now it was SQL Server 6.5, 7 etc.....

Now the problem my queries are failing with SQL Server 2000. I found out the
reason. Previous versions of SQL accepted connections by the named pipes
protocol . Now SQL 2000 accepts only in TCP/IP.

Can any one suggest how I can make a if else if condition in the code and
try to connect to the database if failed then change the connection protocol
type and then connect again.

Thanks and regards,

Tue, 22 Feb 2005 14:00:26 GMT  
 Creating a system dsn or file dsn

It is possible to specify that you want your connection to use TCP/IP
instead of using Named Pipes.  Here are two connection strings for your
reference.  The argument that you are most interested in is the Network
Library=DBMSSOCN.  This indicates that the connection should be made using

This first connection string is using the SQL OLEDB Provider:

   "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial
   Catalog=pubs;Data Source=YourDataSourceName;Network Library=dbmssocn"

 The following connection string is using the OLEDB Provider for ODBC
drivers and a DSN.

   "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Extended
   Library=dbmssocn;Initial Catalog=pubs"

I would recommend the following two articles for your reference:

"Q238949 HOWTO: Set the SQL Server Network Library in an ADO Connection"
found at:

"Q137635 INF: ODBC SQL Server Connection Parameters" found at:

Good luck,

Ellis S.
Microsoft Visual Basic
Technical Support

This posting is provided "AS IS" with no warranties, and confers no rights.

Are you secure?  Please visit for
information about the Strategic Technology Protection Program and to order
your FREE Security Tool Kit.

Wed, 23 Feb 2005 03:31:08 GMT  
 [ 2 post ] 

 Relevant Pages 

1. Crystal and ODBC DSN/DSN-less connections - do I need USER DSN or SYSTEM DSN

2. which Dsn(Data Source Name) is Faster System DSN Or File DSN

3. DSN System or DSN File ?

4. System DSN vs File DSN for Crystal Repots Printing

5. Connect SQL-SERVER via File DSN or DSN LESS

6. which Dsn(Data Source Name) is Faster System DSN Or File DSN.

7. create system dsn in vba

8. Creating System DSN

9. Creating ODBC System DSN by using ODBC API ?

10. Creating a System DSN, HELP

11. Creating a system DSN with VB

12. Create System DSN on the fly


Powered by phpBB® Forum Software