Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO Components Connection Problem

Status
Not open for further replies.

Grudge

Programmer
Jul 30, 2002
23
0
0
ZA
Hi Guys,

I got a problem with ADO components. I've got a little program running on a server which does updates certain records to another sql server if certain conditions are met. That works fine, without any problem. The problem comes in when the connection fails (due to the other server being off), any reconnection to that server fails, even though the server is back on. Only restarting the application works. I created a test application which tests this theory : if a ADO component (ADOQuery) tries to connect and it fails, then it won't reconnect until I restart the application. On the other hand if I replace the components with BDE components then it reconnects fine after it loses the first connection. Is this a bug in the ADO components ? Unfortunately I need to use ADO and can't use BDE (customer specs). Any ideas ?
 
Are you using the TADOConnection component ro are you using just the ADOQuery? The reason I ask is the ADOConnection has the OnDisconnect event that should allow you to reset the connection.

Another problem may be with the actual provider. MS has an ADO SDK kit that has some info in it.

James P. Cottingham
[sup]
There's no place like 127.0.0.1.
There's no place like 127.0.0.1.
[/sup]
 
I think the question is because of ADO using cached connection.In ADO ,microsoft will pooled ado connection automaticlly.
We know a database connection contains server process and client process.So when connection disconnected suddenly,the client process will not be destroyed.So u use adodb.connection.open will get old connection with no server process.
So I suggest u change ado connection string to cheat ado connection manager,it will make a new connection.



WENG YAN
 
thanks wengyan, hmm, this actually makes sense. I'll try it out and let you guys know. Thanks for all the ideas and tips.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top