Access Violation accessing Microsoft Access

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
yeohray2
Posts: 21
Joined: Thu 08 May 2014 15:49

Access Violation accessing Microsoft Access

Post by yeohray2 » Thu 08 May 2014 16:02

When accessing a Microsoft Access table with

- FetchAll = False
- Unidirectional = True
- FetchRows = 5

If the table has a multiple of 5 rows e.g. 5, 10, 15 rows, I receive an access violation error when calling the Next method of TUniQuery when the dataset is at the last record. Using MadExcept, the error seems to be happening at the TMemData.SetRecordNo method i.e.

Image

The code to reproduce this error is as follows:

Code: Select all

qryMain.SpecificOptions.Values['FetchAll'] := 'False';
qryMain.FetchRows := 5;
qryMain.UniDirectional := True;
qryMain.SQL.Text := 'SELECT * FROM table001';
qryMain.Open;
The test database can be found here http://www.happydurian.com/downloads/de ... c_test.mdb

It looks similar to the issue reported here - http://forums.devart.com/viewtopic.php? ... adc#p97994

Any help would be much appreciated. Thanks in advance.

yeohray2
Posts: 21
Joined: Thu 08 May 2014 15:49

Re: Access Violation accessing Microsoft Access

Post by yeohray2 » Fri 09 May 2014 01:04

More details:

The code to reproduce the error is actually as follows:

Code: Select all

qryMain.SpecificOptions.Values['FetchAll'] := 'False';
qryMain.FetchRows := 5;
qryMain.UniDirectional := True;
qryMain.SQL.Text := 'SELECT * FROM table001';
qryMain.Open;

while not qryMain.Eof do
  qryMain.Next;
The error happens when scrolling past the last record.

I'm using Delphi 2009, and the FastMM memory manager. I can reproduce the error in Windows XP and 7.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Access Violation accessing Microsoft Access

Post by AlexP » Mon 12 May 2014 05:54

Hello,

We cannot reproduce the problem. Please try to reproduce the problem on the latest UniDAC version 5.3.8.

yeohray2
Posts: 21
Joined: Thu 08 May 2014 15:49

Re: Access Violation accessing Microsoft Access

Post by yeohray2 » Mon 12 May 2014 16:04

I have prepared a small application that reproduces the error. You can download the source and test database here http://www.happydurian.com/images/source.zip.

It runs a couple of test combinations, and gives me the following errors even using Unidac 5.3.8.

Image

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Access Violation accessing Microsoft Access

Post by AlexP » Tue 13 May 2014 08:21

Thank you for the information. We have reproduced the problem. It occurs only when using memory manager. If you disable FastMM, your application will correctly. We will investigate the reasons for such behavior and inform you about the results.

yeohray2
Posts: 21
Joined: Thu 08 May 2014 15:49

Re: Access Violation accessing Microsoft Access

Post by yeohray2 » Tue 13 May 2014 11:21

I've used both FastMM and SafeMM, and both report errors at the same location:

Image

Is it possible that because the dataset is unidirectional, the cache is cleared, but because there are no longer any records to fetch, the error then occurs when TMemData.SetRecordNo tries to set the bookmark to the cache area that had already been cleared?

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Access Violation accessing Microsoft Access

Post by AlexP » Wed 14 May 2014 10:29

We have already fixed this problem. The fix will be included to the next version.

yeohray2
Posts: 21
Joined: Thu 08 May 2014 15:49

Re: Access Violation accessing Microsoft Access

Post by yeohray2 » Wed 14 May 2014 16:54

Is there any way I can get the fix now? It's an urgent issue for me. Thanks.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Access Violation accessing Microsoft Access

Post by AlexP » Fri 16 May 2014 07:13

I can send you the night build including the fix. Please send your license number, IDE version to alexp*devart*com and specify the e-mail where we can send the build.

Post Reply