WiFi connection to FireBird DB (FB v5)

41 views
Skip to first unread message

Lagom

unread,
Aug 6, 2026, 10:00:34 AM (7 days ago) Aug 6
to firebird-support
I need help with connecting to a database via Wi-Fi.
Error when disconnecting from the database:
[FireDAC][Phys][FB]SQL error code = -504 (Invalid cursor reference / Cursor is not open).

I’m not losing the connection (ping works from the laptop to the server without a timeout).

Does anyone have a solution to this problem?
Does anyone here works over Wi-Fi?
Any suggestions regarding server configuration?

Mark Rotteveel

unread,
Aug 6, 2026, 10:03:19 AM (7 days ago) Aug 6
to firebird...@googlegroups.com
The error has nothing to do with your connection or server
configuration. It means you or your application are trying to fetch from
a statement, while that statement doesn't have a cursor (or its cursor
was already closed).

What does the code do that produces this error, and what statement is it
trying to execute?

Mark
--
Mark Rotteveel

Lagom

unread,
Aug 7, 2026, 4:29:59 AM (6 days ago) Aug 7
to firebird-support
Hi Mark,
The error message is below. It's in Polish, so I've added a translation.

---------------------------------------------PL
Kod wyjątku : 335544577
Kod SQL : 335544577
Baza danych :SystemDatabase
Obiekt :TstSQL
Treść : [FireDAC][Phys][FB]Attempt to reclose a closed cursor
Skrypt:
SELECT Wartosc FROM KonfUzyt WHERE (NumerParam = :NumerParam)
and (Id_Uzytkownik = :Id_Uzytkownik)
Parametry:
NUMERPARAM: 263
ID_UZYTKOWNIK: 14870092

--------------------------------------------------EN-----------------
Translate
Exception Code: 335544577
SQL Code: 335544577
Database: SystemDatabase
Object: TstSQL

Message: [FireDAC][Phys][FB]Attempt to reclose a closed cursor

Script:
SELECT Value FROM UserConf WHERE (ParamNumber = :ParamNumber)
and (UserID = :UserID)

Parameters:
PARAMNUMBER: 263
USERID: 14870092


Do you have any ideas how I can fix it? 
Best regards

Dimitry Sibiryakov

unread,
Aug 7, 2026, 4:35:23 AM (6 days ago) Aug 7
to firebird...@googlegroups.com
Lagom wrote 07.08.2026 10:29:
> The error message is below.

The error message is in English, so it doesn't need translation. And this is
different error from one in your first message.

> Do you have any ideas how I can fix it?

You need analyse your Deplhi code to make sequence of operations right and
predictable: prepare-open-fetch-close.

--
WBR, SD.

Mark Rotteveel

unread,
Aug 8, 2026, 10:47:44 AM (5 days ago) Aug 8
to firebird...@googlegroups.com
On 07-08-2026 10:29, Lagom wrote:
> Hi Mark,
> The error message is below. It's in Polish, so I've added a translation.

> Message: [FireDAC][Phys][FB]Attempt to reclose a closed cursor

This is a different error message than in your topic start, but this one
indicates that you're trying to close a cursor that was previously closed.

However, this sounds like a threading problem in your application. For
example, using the same connection, statement, etc. from multiple
threads, where one thread closed a statement or executed something else,
while another tries to fetch from that same statement.

Mark
--
Mark Rotteveel
Reply all
Reply to author
Forward
0 new messages