Page 1 of 1

Access Viloation on adding SepecificOption

Posted: Thu 09 Feb 2017 13:10
by vejazi
I have a project that was created in Delphi 2007 and is now being ported to XE10.1. In the old Delphi we used UniDAC 4.5/4.6, now with XE10.1 we are using 6.4.

What happens is when the following lines is execute I get an Access Violation on the last line.

Code: Select all

  Connection := TUniConnection.Create (nil);
  Connection.ProviderName := 'SQLite';
  Connection.Database := GlobalConfigFilePath + 'Labels.s3db';
  Connection.SpecificOptions.Values['ForceCreateDatabase'] := 'true';
  Connection.SpecificOptions.Values['FetchAll'] := 'true';
I know that FetchAll does not exist for connections and that I should get an exception stating just that. But that is exactly my problem. When I create a new project in XE10.1 and do the same I get exactly the expected exception.

What could be the reason for not getting the exception but an access violation?

Re: Access Viloation on adding SepecificOption

Posted: Fri 10 Feb 2017 12:13
by MaximG
The SpecificOptions.Values['FetchAll'] property is absent in the TuniConnection component. So it was present in the previous UniDAC versions. However, when executing the Connection.SpecificOptions.Values['FetchAll'] := 'true' code; in the previous UniDAC versions the corresponding error was not generated. Delete Connection.SpecificOptions.Values['FetchAll'] in your project code.

Re: Access Viloation on adding SepecificOption

Posted: Fri 10 Feb 2017 14:31
by vejazi
Thanks for the clarification on the "FetchAll" option. So it was not a faulty implementation from my side to set it in the connection in the old version.

None the less I do get an Access Violation instead of an Exception. I only get the correct Exception when I execute the instructions in a newly created project. When I run my "converted " project (D2007 to D10.1) I get the Access Violation.

I know this is probably not a UniDAC problem, but at the Moment it just happens in this location with the TUniConnection component.

Re: Access Viloation on adding SepecificOption

Posted: Thu 16 Feb 2017 11:08
by MaximG
We checked the following statement work :

Code: Select all

Connection.SpecificOptions.Values['FetchAll'] := 'true';
using UniDAC 6.4.16 for Delphi 2007 and RAD Studio 10.1 Berlin. In both cases we got a corresponding exception. Unfortunately we could not get the described Access Violation error. For further investigation, please compose a small project in which the problem occurs. You can send this sample using the e-support form( https://www.devart.com - menu "Support"\"Request Support" )