Firebird 2.1 Embedded, error -501 on close

The stable tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.
Post Reply
mafro_cz
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 27.03.2013, 15:32

Firebird 2.1 Embedded, error -501 on close

Post by mafro_cz »

Hi,

I use Firebird 2.1 embedded (protocol: firebirdd_2.1) and in this code:

Code: Select all

     With TZReadOnlyQuery.create(nil) do begin
          Connection:=ZConnection2;
          Close;
          with UserPropertyForm do begin
               SQL.Clear;
               SQL.Add('Insert InTo SPRAVCI (UserName,UserPass) values('''+NewUserEdit.text+''','''+NewPasswordEdit.text+''') returning IDSpravci;');
               Open;
               Result:=FieldByName('Idspravci').asInteger;
               end;
          close;
          Free;
          end; //with ReadOnlyQuery
get error -501 on the last close.

On Firebird 2.1 server (protocol firebird_2.1) it is ok.

Can someone help me where is problem and how to correct it?

I'm using version 7.0.3-stable and XE.

Thanks in advance.
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1935
Joined: 17.01.2011, 14:17

Post by marsupilami »

Hello mafro_cz,

What is the message of the -501 error, you get? These SQL-Codes tend to be quite ambigous. This applies to the -501 error too - it has at least two possible meanings.

If you need an immediate solution and it works, I can only suggest to use firebird_2.1 now and use the LibraryLocation property of TZConnection to point to the embedded library.

Best regards,

Jan
mafro_cz
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 27.03.2013, 15:32

Post by mafro_cz »

error -501 is:

Code: Select all

... exception class EZSQLException with message 'SQL Error: Dynamic SQL Error SQL error code = -501 Attempt to reclose a closed cursor. Error Code: -501. The cursor identified in a FETCH or CLOSE statement is not open.'. 
Post Reply