Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2001-06-13
4
Medium Priority
?
172 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 200 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

Independent Software Vendors: 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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses

610 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