Solved

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

Posted on 2001-06-13
4
168 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
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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Microsoft Access 97 and Delphi XE2 9 74
backup program with robocopy 6 74
transition to visual .net from vb6 5 63
Delphi Firemonkey : user drawing in window 3 27
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

733 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