Topic: AV on LookUp
Delphi = 7 and 2010
Component = 0.45
SqliteLibrary = 3.6.18
Access Violation in all lookup fields.
Procedure TSqlitePassRecordset.SetFieldAsAnsiString(RecordIndex, FieldIndex: Integer; Value: AnsiString);
var
StrIndex: Integer;
begin
if FieldIsNull(RecordIndex, FieldIndex)
then AddAnsiString(RecordIndex, FieldIndex, Value)
else begin
StrIndex := PInteger((FRecords[RecordIndex] + FInternalFieldsOffset[FieldIndex]))^;
FAnsiStrings[StrIndex] := Value; // <-!!! AV HERE!
//StrIndex=random data
//Value=correct text
end;
end;
_______________________
Field Example:
object SqlitePassDataset1look: TStringField
Tag = 3
FieldKind = fkLookup
FieldName = 'look'
LookupDataSet = SqlitePassDataset2
LookupKeyFields = 'index'
LookupResultField = 'text'
KeyFields = 'lookup'
LookupCache = True
Lookup = True
end
---------------------------
Debugger Exception Notification
---------------------------
Project Project1.exe raised exception class EAccessViolation with message 'Access violation at address 00404150 in module 'Project1.exe'. Write of address 011A82E8'. Process stopped. Use Step or Run to continue.
---------------------------
Last edited by heX (2010-02-04 12:41:06)