Recent

Author Topic: Help with use of fblib + freepascal  (Read 5769 times)

AkiFoblesia

  • New member
  • *
  • Posts: 9
Help with use of fblib + freepascal
« on: July 15, 2007, 04:38:56 am »
hi!

below is an fblib example code that does not run properly with this error: "Range Check Error". The error appears even if i use {R-}.

Connection, however, is successful. The error appears on this code: 'fbdb.ExecSQL;'.

help please.


thanks :D


========================================

     program testsimple;
     uses
       SysUtils, FBLSimple;
     var
       fbdb: TFBLSimple;
       conn,user,passwd: string;  //connection string
     begin
       conn := 'localhost:c:\db\juventus.fdb' ;
       user := 'sysdba' ;
       passwd := 'masterkey' ;
       fbdb := TFBLSimple.Create(conn,user,passwd);
       try
         try
           fbdb.Connect;
           fbdb.StartTransaction;
           fbdb.SQL.Text := 'SELECT * FROM PLAYERS' ;
           fbdb.ExecSQL;  {cause of error}
           while not fbdb.Eof do
           begin
             WriteLn(fbdb.FieldbyNameAsString('player_id' ));
             WriteLn(fbdb.FieldbyNameAsString('name' ));
             WriteLn(fbdb.FieldbyNameAsString('number' ));
             WriteLn('' );
             fbdb.Next;
           end;
          fbdb.Close;
          fbdb.Commit;
          fbdb.Disconnect;
        except
          on E:Exception do
            WriteLn(E.Message);
        end;
      finally
       fbdb.Free;
      end;
    end.

Almindor

  • Sr. Member
  • ****
  • Posts: 412
    • http://www.astarot.tk
RE: Help with use of fblib + freepascal
« Reply #1 on: July 15, 2007, 09:29:50 am »
Where's the FBLSimple unit from? It looks like it was compiled (that unit not your program) with range checking turned on. If you compiled that unit or have access to it try turning range check off on it, or find out where the range check error occurs and fix it (it might be a bug in the unit)

AkiFoblesia

  • New member
  • *
  • Posts: 9
Re: RE: Help with use of fblib + freepascal
« Reply #2 on: July 15, 2007, 01:41:35 pm »
Quote from: "Almindor2"
Where's the FBLSimple unit from? It looks like it was compiled (that unit not your program) with range checking turned on. If you compiled that unit or have access to it try turning range check off on it, or find out where the range check error occurs and fix it (it might be a bug in the unit)


you are right. the {$R-} was supposed to be applied on another unit.
thanks sir :D

 

TinyPortal © 2005-2018