Range check error with Delphi 7, Zeos, Postgresql

mvbortolli
mvbortolli used Ask the Experts™
on
Running Delphi 7 with Zeos and Potgresql, occurs "Range check error" on Zeos, on zdbcCache.pas, on line

          FBuffer.Columns[FColumnOffsets[ColumnIndex - 1]] := 0;

It's weird, cause it's running early. I'm using Postgres 8.2 now, but testing with 8.3 and nothing.
Zeos Version 6.6.3 stable.

procedure TZRowAccessor.SetPChar(ColumnIndex: Integer; Value: PChar);
begin
{$IFNDEF DISABLE_CHECKING}
  CheckColumnConvertion(ColumnIndex, stString);
{$ENDIF}
  case FColumnTypes[ColumnIndex - 1] of
    stString:
      begin
        if Value <> nil then
        begin
          FBuffer.Columns[FColumnOffsets[ColumnIndex - 1]] := 0;
          StrLCopy(@FBuffer.Columns[FColumnOffsets[ColumnIndex - 1] + 1], Value,
            FColumnLengths[ColumnIndex - 1] - 1);
        end else
          FBuffer.Columns[FColumnOffsets[ColumnIndex - 1]] := 1;
      end;
    else
      SetString(ColumnIndex, Value);
  end;
end;

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
  1. Run this in debug mode with a breakpoint on line 11;
  2. When it hits the breakpoint, check the value of ColumnIndex;
  3. Next check the value of FColumnOffsets[ColumnIndex - 1];
I suspoect that step 3 above will give you your answer.  
By the way, these are steps I would use in debugging this problem if it were in an application I was writing.
Commented:
Your best bet is to post this on the zeoslib forums. Just google Zeoslib, visit their website, and look for the forum link.
Also it wouldn't hurt to make sure you have the latest version of Zeoslib

Author

Commented:
I find the problem. Unafortunately, just Zeos version 6.5.1 is compatible with my postgresql database. So, I download early version and problem solved. Thanks.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial