Click here to Skip to main content
15,919,178 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
my problem is i write a dll(the dll is connect to the sql server database to get records) if the MSSQLSERVER is up,my dll work good。 but when i restart MSSQLSERVER servers ,dll don't work 。when the dll init,it will connect to the database.but when the MSSQLSERVER restart,the ADODB::_ConnectionPtr m_pConnection don't change. so how do i keep the m_pconnection is effiective(keep connection the database) uing a timer to keep? or.......
Posted

1 solution

if the connection gets lost, you will fetch some exceptions on the next operations. Check them and reconnect.

Export some functions from the dll to enhance your interface.

A timer is bad. You better set good values for that on the database.

And dont ferget: bad things can happen, so prepare to resume from errors.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900