PDA

Click to See Complete Forum and Search --> : Force DNSLess connection to use TCP/IP


Nov 8th, 2000, 01:47 PM
OK. Hopefully someone can save me from pulling all my remaining hairs out.

I have written a database application that connects to a SQL Server database on a remote machine through a dial-up connection. I need to use TCP/IP connectivity (as opposed to named pipes) to connect to the database. My application uses a DSNless connection to the database. It is my understanding that DSNless connections use named pipes by default. I need to be able to force the DSNless connection to use TCP/IP through the code itself.

What I am seeing now is, when I install the application and attempt to run it, it cannot access the database. However, if I create an ODBC data source, force the connection to use TCP/IP (through client configuration), test the connection successfully, and then delete the data source, my application then connects fine. Make sense? It seems that somewhere it forces the connection over TCP/IP instead of named pipes after I have made the connection manually once.

Does this make sense? My application is working fine, it's just wierd that I have to create a DSN connection and then delete it before I can use the DSNless connection through code.

Any ideas?

Thanks!!!

Dan

hemali
May 9th, 2001, 03:55 AM
hi there,
i can't answer your Qs, but if u can let me know how u made the remote connectivity thru your VB appli ? what exactly is to be done ?

thanx
htr

hemali
May 9th, 2001, 04:35 AM
hi there,
i can't answer your Qs, but if u can let me know how u made the remote connectivity thru your VB appli ? what exactly is to be done ?

thanx
htr

danshap
May 9th, 2001, 12:55 PM
There were no special calls made to connect over the internet to the database that I needed. I used standard ADO connections, commands, and recordsets to carry out all the transactions.

Thanks!!!

Dan

Yash_Kumar
May 10th, 2001, 06:34 AM
Could you give an example, I've been desperately looking for away to connect to a remote database using ado. I found out you do so ba service called Remote Data Services, but I could not quite figure out how to use it. Could you please post an example. And, is it possible to connect to a Microsoft Access database also?

danshap
May 10th, 2001, 08:15 AM
The code I used to connect to the remote database is no different than if I were connecting to a database on my local network. I just assume that the internet connection has been established and carry out all my commands as normal.

The application I created is not exactly robust. It is a small app that I am using to update the database. If something fails (the connection isn't there or gets dropped), I'm not really worried about it.

If needed, email me directly (shap@magpage.com) and I'll send you some of my code.

Thanks!!!

Dan