Ignore:
Timestamp:
Feb 26, 2007, 11:57:02 PM (18 years ago)
Author:
alloc
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • oup/current/DataAccess/Access_OUP_ADB.pas

    r113 r116  
    3333
    3434    function GetDatLinks(FileID: Integer): TDatLinkList; override;
     35    function GetDatLink(FileID, DatOffset: Integer): TDatLink; override;
    3536    function GetRawList(FileID: Integer): TRawDataList; override;
    3637    function GetRawInfo(FileID, DatOffset: Integer): TRawDataInfo; override;
     
    4748
    4849uses
    49   SysUtils, Data, Functions, ABSDecUtil, DB;
     50  SysUtils, Data, Functions, ABSDecUtil, DB, DatLinks;
    5051
    5152
     
    445446
    446447
     448
     449function TAccess_OUP_ADB.GetDatLink(FileID, DatOffset: Integer): TDatLink;
     450begin
     451  Result := DatLinksManager.GetDatLink(FConnectionID, FileID, DatOffset);
     452  FQuery.SQL.Text := 'SELECT target_id FROM linkmap WHERE src_id = ' + IntToStr(FileID) + ' and src_link_offset = ' + IntToStr(DatOffset) + ';';
     453  FQuery.Open;
     454  if FQuery.RecordCount > 0 then
     455    Result.DestID := FQuery.FieldByName('target_id').AsInteger;
     456  FQuery.Close;
     457end;
     458
     459
     460function TAccess_OUP_ADB.GetDatLinks(FileID: Integer): TDatLinkList;
     461var
     462  i: Integer;
     463  SrcOffset, DestID: Integer;
     464begin
     465  Result := DatLinksManager.GetDatLinks(FConnectionID, FileID);
     466  if Length(Result) > 0 then
     467  begin
     468    FQuery.SQL.Text := 'SELECT src_link_offset, target_id FROM linkmap WHERE src_id = ' + IntToStr(FileID) + ' ORDER BY src_link_offset ASC;';
     469    FQuery.Open;
     470    if FQuery.RecordCount > 0 then
     471    begin
     472      repeat
     473        SrcOffset := FQuery.FieldByName('src_link_offset').AsInteger;
     474        DestID := FQuery.FieldByName('target_id').AsInteger;
     475        for i := 0 to High(Result) do
     476          if Result[i].SrcOffset = SrcOffset then
     477            Break;
     478        if i < Length(Result) then
     479          Result[i].DestID := DestID
     480        else
     481          Result[i].DestID := -1;
     482        FQuery.Next;
     483      until FQuery.EOF;
     484    end;
     485    FQuery.Close;
     486  end;
     487end;
     488
     489
    447490function TAccess_OUP_ADB.GetRawList(FileID: Integer): TRawDataList;
    448491var
Note: See TracChangeset for help on using the changeset viewer.