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)

Re: AV on LookUp

Hex,

Thanks for reporting this problem.

I currently prepare the 0.50 version. It should solve your problem(s) with lookup fields and bring a lot of speed improvement with in memory indexes for locate, lookup operations and lookupfields.

I plan to release the new package by the end of february.
As a quick fix, you can use SQL and join tables in a query in order to display the requested lookup information.

Regards.

Luc