Firebird path ZEOS lazarus / 16-Databases ---------------------------------------------------------------------- flori · 2021-03-31 11:43 Hi everyone! I have a small database , GDB.. The database file is on the server (\\FLORI\Users\flori) I set: Database: \\FLORI\Users\flori\DB\my.GDB Host: 192.168.0.20 pass: masterkey user:sysdba Protocol: firebirdd-2.5 but unfortunately doesn’t want to make a connection. I use Zeos comp. Thank you ---------------------------------------------------------------------- Gustavo 'Gus' Carreno · 2021-03-31 11:55 Hey Flori, Embedded Firebird does not work with network paths. This was brought up on a rather recent thread here about a single file database that could be accessed via a network path. The conclusion is that only SQLite is capable of such, but even then it depends on the version of the network protocol for remote drives. Cheers, Gus ---------------------------------------------------------------------- flori · 2021-03-31 12:09 https://firebirdsql.org/manual/qsg10-connecting.html what is your opinion? ---------------------------------------------------------------------- Gustavo 'Gus' Carreno · 2021-03-31 12:15 Hey Flori, Quote from: flori on March 31, 2021, 02:09:26 pmhttps://firebirdsql.org/manual/qsg10-connecting.html what is your opinion?  My opinion is that we are entering the oranges to apples danger zone. Let's try the apples to apples approach: That manual page is for a client-server situation and not an embedded situation. In an embedded situation where there is no server, the application itself manages the database file. Case in point: You list your database as \\FLORI\Users\flori\DB\my.GDB, clearly a windows network pathThe link you provided says, for windows, the connection string should be serverxyz:C:\Program Files\Firebird\examples\employee.gdb Can you spot the difference?! Now, what's YOUR opinion? ;-P Cheers, Gus ---------------------------------------------------------------------- balazsszekely · 2021-03-31 12:25 @flori Database path should be relative to server: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i    IBConnection1.HostName := '192.168.0.20';   IBConnection1.DatabaseName := 'c:\users\flori\DB\my.GDB';   IBConnection1.UserName := 'sysdba';   IBConnection1.Password := 'masterkey';   IBConnection1.Connected := True; this also works: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i    IBConnection1.DatabaseName := '192.168.0.20:c:\users\flori\DB\my.GDB';   IBConnection1.UserName := 'sysdba';   IBConnection1.Password := 'masterkey';   IBConnection1.Connected := True; And watch the firewall on 192.168.0.20, it can block you in an instant. ---------------------------------------------------------------------- Gustavo 'Gus' Carreno · 2021-03-31 12:33 Hey Flori and GetMem, @GetMem: You're spot on the code for a situation where Flori has a Firebird server running on 192.168.0.20. @Flori: Do you have a Firebird server instance running on 192.168.0.20? Because if not, you should, since Firebird embedded does not work on network paths. When you do, take care to follow GetMem's instructions on code AND on the firewall. Not trying to be a prick or a condescending arse, just want to make sure we on an apples to apples situation. Cheers, Gus ---------------------------------------------------------------------- flori · 2021-03-31 13:40 Yes FB server  instance running on 192.168.0.20 ---------------------------------------------------------------------- Gustavo 'Gus' Carreno · 2021-03-31 14:23 Hey Flori Quote from: flori on March 31, 2021, 03:40:16 pmYes FB server  instance running on 192.168.0.20 That's cool. That's perfect! Now: have you made your code like GetMem posted and have you paid attention to the firewall also? Cheers, Gus ---------------------------------------------------------------------- flori · 2021-03-31 15:10 Tomorrow I will try on Server. But I create Network Drive at home and I set up  flori (\\192.168.0.20)(Z) map. I set on Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i DatabaseName: 192.168.0.20:Z:\DB\my.GDB   but unfortunately doesent work. I get SQL error unavailable ... ---------------------------------------------------------------------- Gustavo 'Gus' Carreno · 2021-03-31 15:54 Hey Flori, Ok, another scenario: You have you server managing/pointing at a local file C:\path\to\database.gdb and then you decide to share that folder so you can access the file from another machine. Well, if the server is using that file, it will most probably lock it and do not allow any other instance, either server or embedded, to access it, since like I said, Firebird does not work via shared paths. So now you configure your applications to access \\ServerORipAddress\path\to\database.gdb and in doing so, you're violating the lock put by the server. Like I said, in the very dangerous apples to oranges situation. You should never be in a situation where the file managed by the server is accessible by any other means. And if you're planning on using embedded, the file must be in a NON networked path. I duuno, like the same folder the binary/exe is, or the likes. Same files system, not remote/networked! Make sure that if you have a Firebase server that is managing a file, please don't make it worse by pointing a network path to it, ok? Thanks Cheers, Gus ---------------------------------------------------------------------- balazsszekely · 2021-03-31 16:02 Quote but unfortunately doesent work. I get SQL error unavailable ...Open a cmd(as admin), then type:   Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i ping 192.168.0.20 Does it work? If not, temporaly disable firewall on 192.168.0.20. Alternatively you can directly test port 3050 by installing telnet(Turn windows features on and of-->Add telnet client), then type in cmd: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i telnet 192.168.0.20 3050 Is 192.168.0.20 available? Is port 3050 on 192.168.0.20 open? ---------------------------------------------------------------------- flori · 2021-03-31 16:44 GetMem the ping results: Ping statistics for 192.168.0.20:     Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), yes I tried telnet. port is open ---------------------------------------------------------------------- flori · 2021-03-31 17:04 how can I set on ZConnection protocol type: Local, IPX, Netbeui or TCP/IP? ---------------------------------------------------------------------- balazsszekely · 2021-03-31 17:27 @flori QuotePackets: Sent = 4, Received = 4, Lost = 0 (0% loss), yes I tried telnet. port is openGreat! At least we know the servers is available. I just installed zeos, only the first solution works: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i IBConnection1.HostName := '192.168.0.20';IBConnection1.DatabaseName := 'c:\users\flori\DB\my.GDB';IBConnection1.UserName := 'sysdba';IBConnection1.Password := 'masterkey';IBConnection1.Connected := True; The following code fails for some reason with zeos, works fine though with TIBConnection. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i DatabaseName := '192.168.0.20:Z:\DB\my.GDB' Quotehow can I set on ZConnection protocol type: Local, IPX, Netbeui or TCP/IP?I don't know, but since I can connect to a remote server without setting TCP/IP(zeos included), the issue must be something else. ---------------------------------------------------------------------- flori · 2021-03-31 17:35 GetMem did you try when you create Network Drive and share to folder? The GDB. move to folder. ---------------------------------------------------------------------- Gustavo 'Gus' Carreno · 2021-03-31 18:16 Hey all, Quote from: flori on March 31, 2021, 07:35:01 pmGetMem did you try when you create Network Drive and share to folder? The GDB. move to folder. I give up. @GetMem: If you can solve this one, I'll let with you. There's only so many times I can say that Firebird does not work via network paths Thanks!! Cheers, Gus ---------------------------------------------------------------------- balazsszekely · 2021-03-31 18:34 @Gustavo 'Gus' Carreno,  @flori Quote@GetMem: If you can solve this one, I'll let with you. There's only so many times I can say that Firebird does not work via network pathsI don't understand why a network path is needed when firebird runs on 192.168.0.20. Anyways according to the documentation firebird does work via network paths too, but it's not recommended: http://www.firebirdfaq.org/faq46/ ---------------------------------------------------------------------- Gustavo 'Gus' Carreno · 2021-03-31 18:49 Hey GetMem, Quote from: GetMem on March 31, 2021, 08:34:06 pmI don't understand why a network path is needed when firebird runs on 192.168.0.20. I'm with you here. Hence me giving up. Why insist on the thing so much? What is he not explaining to us? Quote from: GetMem on March 31, 2021, 08:34:06 pmAnyways according to the documentation firebird does work via network paths too, but it's not recommended: http://www.firebirdfaq.org/faq46/ When there's the possibility that there's gonna be a situation where 2 apps can be writing simultaneously to the same *.gdb and corrupting it, for me it's more of a doesn't work kinda situation. But that could just be me Cheers, Gus ---------------------------------------------------------------------- flori · 2021-03-31 20:43 Thank u everyone I add new Inbound rules on WinDef. and I set Firebird 3050 port. Just work. The data transferring is ok. ---------------------------------------------------------------------- Gustavo 'Gus' Carreno · 2021-03-31 20:51 Hey Flori, Quote from: flori on March 31, 2021, 10:43:52 pmThank u everyone I add new Inbound rules on WinDef. and I set Firebird 3050 port. Just work. The data transferring is ok. Arghhh, dude!! I should pull a Jethro Gibbs and pop out of your monitor and smack you on the back of the head. Didn't GetMem mention you made sure the Firewall was good in like his first answer!?!??!?!!??!!? GRRRRRRR!! Well, whateves. What counts is that we have another satisfied customer! @GetMem: You deserve a nice pat on the back, and probably a beer, on Flori's tab ofc You've earned it ehehe Cheers, Gus ---------------------------------------------------------------------- flori · 2021-03-31 21:01 Gustavo 'Gus' Carreno My friend!! First I set on the server 3050 open port. I doesent set on my dekstop. I thought it was enough just on the server Second: if you are angry then go run! ---------------------------------------------------------------------- Gustavo 'Gus' Carreno · 2021-03-31 21:10 Hey Flori, Quote from: flori on March 31, 2021, 11:01:05 pmFirst I set on the server 3050 open port. I doesent set on my dekstop. I thought it was enough just on the server Ermm, I'm with you there. I thought you only needed the server to open up. At least that's how we do it on Linux. I'm as baffled as you that you had to do it on the client side as well... This is why I hate Windows some times Quote from: flori on March 31, 2021, 11:01:05 pmSecond: if you are angry then go run!  Awwww I'm not mad. I was just making some noise like an angry gorilla Big bark, no bite kinda situation Hey I'm Portuguese, sometimes I'm a bit loud and flamboyant  Cheers, Gus