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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Restarting an Active X control?

Status
Not open for further replies.

99mel

Programmer
Oct 18, 1999
379
GB
Yello everyone,

I have this active X control which goes connects to an SQL Server database and then i have this recordset which i have buttons that MoveNext and MoveLast n stuff.

The problem is that my collegue is also connecting to the database to UPDATE a record. Then when we click on my button in my activeX control it displays an error.

Can i restart the activeX to connect to the database again or somert along the lines of that?

Did that make any sense at all? :)

cheers
 
Fixed it!

well my collegue added an Enable property to the control thus simply setting the activex enable to false when updating and when finished updating setting it to True.

IT works ;-)
 
In settings where there may be possible locks on a dabase, as in your case, you usually will trap for that specific error (you have to find out the error number), and then use a timer to try the update again. If you use this method though, make sure you have some way out (like a counter) that prevents an endless loop in case some unforseeable event happens disallowing a connect for long periods of time...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top