Hi, I use the OnConnectionLost-event to reconnect to the database setting the RetryMode to rmReconnectExecute. Sometime I receive an "access violation" doing this and I think I figured out the problem now: if there are TMSQuery-components with emtpy SQL-property (just designtime) and never openend, the procedure TCustomMSConnection.DoError raizes an exception in line "if TCustomMSDataSet(DataSets).FIRecordSet.GetIRowset nil then ...". To reproduce put a connction with OnconnectionLost-event, a query for northwind customers to a form, open the customers, kill the spid of your connection and refresh the customers-query. this should work fine. Now add an empty query to the same form and retry: an access violation occurs. Hope this helps to fix.
br, Toni
TMSConnection problem in OnConnectionLost-event
-
Challenger
- Devart Team
- Posts: 925
- Joined: Thu 17 Nov 2005 10:53