Page 1 of 1
Access Violation accessing Microsoft Access
Posted: Thu 08 May 2014 16:02
by yeohray2
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.
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.
Re: Access Violation accessing Microsoft Access
Posted: Fri 09 May 2014 01:04
by yeohray2
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.
Re: Access Violation accessing Microsoft Access
Posted: Mon 12 May 2014 05:54
by AlexP
Hello,
We cannot reproduce the problem. Please try to reproduce the problem on the latest UniDAC version 5.3.8.
Re: Access Violation accessing Microsoft Access
Posted: Mon 12 May 2014 16:04
by yeohray2
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.

Re: Access Violation accessing Microsoft Access
Posted: Tue 13 May 2014 08:21
by AlexP
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.
Re: Access Violation accessing Microsoft Access
Posted: Tue 13 May 2014 11:21
by yeohray2
I've used both FastMM and SafeMM, and both report errors at the same location:
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?
Re: Access Violation accessing Microsoft Access
Posted: Wed 14 May 2014 10:29
by AlexP
We have already fixed this problem. The fix will be included to the next version.
Re: Access Violation accessing Microsoft Access
Posted: Wed 14 May 2014 16:54
by yeohray2
Is there any way I can get the fix now? It's an urgent issue for me. Thanks.
Re: Access Violation accessing Microsoft Access
Posted: Fri 16 May 2014 07:13
by AlexP
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.