Solved

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

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
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…

759 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now