Changeset 116 for oup/current/DataAccess/Access_OUP_ADB.pas
- Timestamp:
- Feb 26, 2007, 11:57:02 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
oup/current/DataAccess/Access_OUP_ADB.pas
r113 r116 33 33 34 34 function GetDatLinks(FileID: Integer): TDatLinkList; override; 35 function GetDatLink(FileID, DatOffset: Integer): TDatLink; override; 35 36 function GetRawList(FileID: Integer): TRawDataList; override; 36 37 function GetRawInfo(FileID, DatOffset: Integer): TRawDataInfo; override; … … 47 48 48 49 uses 49 SysUtils, Data, Functions, ABSDecUtil, DB ;50 SysUtils, Data, Functions, ABSDecUtil, DB, DatLinks; 50 51 51 52 … … 445 446 446 447 448 449 function TAccess_OUP_ADB.GetDatLink(FileID, DatOffset: Integer): TDatLink; 450 begin 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; 457 end; 458 459 460 function TAccess_OUP_ADB.GetDatLinks(FileID: Integer): TDatLinkList; 461 var 462 i: Integer; 463 SrcOffset, DestID: Integer; 464 begin 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; 487 end; 488 489 447 490 function TAccess_OUP_ADB.GetRawList(FileID: Integer): TRawDataList; 448 491 var
Note:
See TracChangeset
for help on using the changeset viewer.