TMSConnection problem in OnConnectionLost-event

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Posts: 55
Joined: Wed 04 Apr 2007 17:25

TMSConnection problem in OnConnectionLost-event

Post by tonisanta » Fri 03 Oct 2008 16:34

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

Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Mon 06 Oct 2008 13:25

Thank you for detailed information. We have reproduced and fixed this problem.

Post Reply