Solved

Is there any way to enforce default protocol connecting to remote SQL Server using ADO

Posted on 2001-06-13
4
169 Views
Last Modified: 2013-11-23
Is there any way to enforce default protocol (TCP/IP) in the ADO's connection string while connecting to remote SQL Server?

I install my VB app on a WinNT 4.0 SP6 machine from a package created by the Setup Wizard shipped with Visual Basic 6.0 (Service Pack 5 is applied). There is a problem to connect to the remote SQL Server 7 database, though I can ping the remote server both by name and IP address. Application generates an error that it cannot connect to the remote server. After installing SQL Server connectivity tools and changing default protocol to TCP/IP, it works. Is there any way to ensure this connectivity via TCP/IP in the code without the installation of the tools? My application does not use DSN's, a sample of connection string is

strConnect = "Provider=sqloledb;" & _
"Data Source=" & s_ServerName & ";" & _
"Initial Catalog=" & s_DatabaseName & ";" & _
"User Id=" & s_ID & ";Password=" & s_Password & ";"

Thanks!
0
Comment
Question by:tbbrhun
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 

Expert Comment

by:deepkumarjl
ID: 6188359
Hi,

I had faced this problem some time back. The only way I found out of this situation was to manually remove NETBEUI and other protocols from the system. Not a good solution, but it works.

Deep
0
 
LVL 2

Expert Comment

by:kiprimshot
ID: 6188360
set the Network Address Property = ip address of server and set the Network Library = DBMSSOCN

I use the dataenvironment and set it up in the connection properties but I think you can use the connection string as well to do this.

hope this helps
0
 
LVL 18

Accepted Solution

by:
bobbit31 earned 50 total points
ID: 6188535
here is what the connection string would look like:

Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=<init catalog>;
Data Source=<server name>;Network Address=<your ip>;Network Library=DBMSSOCN
0
 

Author Comment

by:tbbrhun
ID: 6188671
bobbit31:

Thanks a lot, works even without specifying IP Address!

Thanks everyone for help!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question