Recent

Author Topic: SQLDB and Firebird4, error when executing  (Read 3215 times)

andersonscinfo

  • Full Member
  • ***
  • Posts: 141
SQLDB and Firebird4, error when executing
« on: August 31, 2023, 08:42:36 pm »
I have the following situation, I have a firebird server on windows, a client machine using linux, I use sqldb, and I am having problems when trying to perform simple tasks such as select, the error is very generic.

Server win10 64b, firebird4
Cliente Linux mint 21

korba812

  • Sr. Member
  • ****
  • Posts: 415
Re: SQLDB and Firebird4, error when executing
« Reply #1 on: August 31, 2023, 08:52:34 pm »
If SQL query returns a set of records (e.g. select statemet) then you must use "Open" method instead of "ExecSQL".

Edit:
Ah. I just noticed "Access violation" in the message. That could be a different problem.
« Last Edit: August 31, 2023, 08:55:19 pm by korba812 »

andersonscinfo

  • Full Member
  • ***
  • Posts: 141
Re: SQLDB and Firebird4, error when executing
« Reply #2 on: August 31, 2023, 09:07:35 pm »
I have the same code (exe) that for windows x windows works perfectly, only for linux (client) x windows (server) that is not working, which leads me to believe it is something with sqldb

rvk

  • Hero Member
  • *****
  • Posts: 6294
Re: SQLDB and Firebird4, error when executing
« Reply #3 on: August 31, 2023, 09:13:31 pm »
I searched the whole source for that error message but it doesn't seem to be a message from Lazarus or FPC itself.

Are you generating that message (including that title of the dialog)?
You have a access violation exception. That's usually something in your own code.

That it works on Windows doesn't guarantee it works on other platforms.
Show us the relevant code (otherwise we can't really help you).
(especially the code around that exception)

andersonscinfo

  • Full Member
  • ***
  • Posts: 141
Re: SQLDB and Firebird4, error when executing
« Reply #4 on: August 31, 2023, 09:18:54 pm »
the environment is as follows, server running windows 10 and firebird4, the example app is a tsqlconector, tsqltransaction and a tsqlquery, in tsqlquery there is only a select * from table; nothing more than that, when trying to open it, even at design time the query already has the error, as long as the server is windows and the client is linux, but I can make a video, and I can also provide access to the environment for testing, as I can also provide the code example, I just didn't find it relevant because it's a test both when simple.

andersonscinfo

  • Full Member
  • ***
  • Posts: 141
Re: SQLDB and Firebird4, error when executing
« Reply #5 on: August 31, 2023, 09:35:09 pm »
I'm sending a link to a video and attaching simple examples, the video I believe helps more than the example.
https://sc10.com.br/videos/fb_win_cl_lin.mp4
Code: Pascal  [Select][+][-]
  1. https://sc10.com.br/videos/fb_win_cl_lin.mp4


andersonscinfo

  • Full Member
  • ***
  • Posts: 141
Re: SQLDB and Firebird4, error when executing
« Reply #6 on: August 31, 2023, 09:39:51 pm »
two observations.

1 - connects normally, just does not execute select, sqls, etc.

2 - I tested it with zeosaccess and with zeos it works normally.

rvk

  • Hero Member
  • *****
  • Posts: 6294
Re: SQLDB and Firebird4, error when executing
« Reply #7 on: August 31, 2023, 10:06:51 pm »
I have a few observations.

You have firebird 4 on port 8095 (this is a non standard port).
You connect to it with flamerobin to port 8095.

The Windows does connect to your external IP but I don't see a port there.
If there is no port given, it connects to port 3050 and there your firebird 3 is listening.

So there could be a lot of things wrong.

First stop the service for firebird 3 and see if your Windows version still connects.
Second... check the databasename. If you connect to firebird 4 your can only use the database for firebird 4.
You can't mix FB3 and FB4 databases.

To go from FB3 to FB4 you need to backup and restore the database.
(although it could be that FB4 is delivered with a FB3 engine, I'm not sure.)

Make sure you also provide the correct port in Lazarus (besides the correct database).

~~
I just tested sqldb in mint21 64bit to connect to my fb3 server on Windows and that works so sqldb shouldn't be the cause.

(BTW. You also didn't mention what version of Lazarus you use and what client of Firebird libfbclient you installed)
« Last Edit: August 31, 2023, 10:19:01 pm by rvk »

andersonscinfo

  • Full Member
  • ***
  • Posts: 141
[SOLVED] Re: SQLDB and Firebird4, error when executing
« Reply #8 on: August 31, 2023, 10:18:12 pm »
problem solved, setei charset UTF8, this was the problem.

thanks.

rvk

  • Hero Member
  • *****
  • Posts: 6294
Re: SQLDB and Firebird4, error when executing
« Reply #9 on: August 31, 2023, 10:19:53 pm »
 :D Yes. I just tested it here and it works fine.

Glad you found the problem.

BTW. The error message could be handled somewhat more gracefully, I admit  :D

 

TinyPortal © 2005-2018