Encrypted Fields Access Violation after Update to 9.4.3

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
OlliWW
Posts: 20
Joined: Mon 25 Mar 2013 17:03

Encrypted Fields Access Violation after Update to 9.4.3

Post by OlliWW » Thu 22 Apr 2021 09:39

Hello,

I'm using SDAC 9.4.3 with Delphi 10.4.2

The previous version was: 9.3.1


Since 9.4.3 i get an access violation when i'm selecting encrpyted fields which are null (not filled with data [yet]).

My Code is exact the same as in the documentation. I'm reading the field with "FieldByName"

Code: Select all

MSQuery.SQL.Text := 'SELECT * FROM EMP';

MSQuery.Encryption.Encryptor := MSEncryptor;
MSQuery.Encryption.Fields := 'ENAME, HIREDATE, SAL, FOTO';
MSEncryptor.Password := '11111';

MSQuery.DataTypeMap.AddFieldNameRule ('ENAME', ftString);
MSQuery.DataTypeMap.AddFieldNameRule ('HIREDATE', ftDateTime);
MSQuery.DataTypeMap.AddFieldNameRule ('SAL', ftFloat);

MSQuery.Open;

myStringVar := MSQuery.FieldByName('ENAME').AsString;

When calling "FieldByName" i get an access violation.

Here is the callstack:

Code: Select all

0082d4e7 +003b Project.exe       CRDataTypeMap                  TDataConverters.ExtBytesToAStr
008632ea +00fa Project.exe       CRAccess                       TCRRecordSet.GetFieldData
007cb59f +00c3 Project.exe       MemData                        TData.GetField
00f7d0ce +002e Project.exe       OLEDBAccess                    TOLEDBRecordSet.GetField
007e57db +0083 Project.exe       MemDS                          TMemDataSet.GetFieldData
007e5592 +0016 Project.exe       MemDS                          TMemDataSet.GetFieldData
00799b53 +0027 Project.exe       Data.DB             13131   +2 TDataSet.GetFieldData
007e5613 +0047 Project.exe       MemDS                          TMemDataSet.GetFieldData
007876ab +0057 Project.exe       Data.DB              5149   +9 TField.GetData
00789767 +0013 Project.exe       Data.DB              6142   +1 TStringField.GetValue
0078954a +000a Project.exe       Data.DB              6073   +1 TStringField.GetAsAnsiString
0078950c +0020 Project.exe       Data.DB              6063   +2 TStringField.GetAsString
0172299d +1211 Project.exe       myClass       570 +282 TmyClass.doread

With 9.3.1 the code above works

Stellar
Devart Team
Posts: 412
Joined: Tue 03 Oct 2017 11:00

Re: Encrypted Fields Access Violation after Update to 9.4.3

Post by Stellar » Fri 23 Apr 2021 14:13

Thank you for providing the information. We've fixed several similar issues, please check whether the issue occurs in nightly build of SDAC.
Please send us your license number, and we'll send you the nightly build of SDAC. You can send the license number using the contact form at our site: devart.com/company/contactform.html

Post Reply