Recent

Author Topic: Unit IbConnection - CreateDB  (Read 5238 times)

fcb

  • Newbie
  • Posts: 2
Unit IbConnection - CreateDB
« on: November 13, 2021, 03:51:54 am »
Hello,

I have a Firebird service installed on another port (3052) instead of using the default 3050, so the CreateDB function of the IBConnection unit does not set the Port variable.
I modified the file (ibconnection.pp) and implemented in line 412...418, in atachment

Thanks
« Last Edit: November 13, 2021, 04:06:31 am by fcb »

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: Unit IbConnection - CreateDB
« Reply #1 on: November 17, 2021, 10:28:37 am »
Wrong thread. Sorry

Zvoni

  • Hero Member
  • *****
  • Posts: 2737
Re: Unit IbConnection - CreateDB
« Reply #2 on: November 17, 2021, 12:16:56 pm »
Hello,

I have a Firebird service installed on another port (3052) instead of using the default 3050, so the CreateDB function of the IBConnection unit does not set the Port variable.
I modified the file (ibconnection.pp) and implemented in line 412...418, in atachment

Thanks
That's bull!
https://www.freepascal.org/docs-html/fcl/ibconnection/tibconnection.html
There is a published property called "Port" (whatever could that be for?!?!)
You'll even find it in the Object Inspector

Could one of the mods remove the OP's attachment,, before someone inexperienced downloads it and borks his installation?
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11935
  • FPC developer.
Re: Unit IbConnection - CreateDB
« Reply #3 on: November 17, 2021, 02:10:59 pm »
Zvoni, language please!

the port is added in the ConnectFB statement.
Code: [Select]
  HN:=HostName;
  if HN <> '' then
    begin
    if Port<>0 then
      HN:=HN+'/'+IntToStr(Port);
    ADatabaseName := HN+':'+DatabaseName
    end
  else
    ADatabaseName := DatabaseName;

If that somehow doesn't work to you, please file a bug on gitlab with an unified DIFF attachment or a pull request. Don't add modified files like this, since due to version issues, that doesn't make very clear what exactly you modified. Describe how you test or encounter the problem.

Zvoni

  • Hero Member
  • *****
  • Posts: 2737
Re: Unit IbConnection - CreateDB
« Reply #4 on: November 17, 2021, 03:17:19 pm »
Zvoni, language please!

Sorry, marco und to OP.
Just having a bad day.....

What really mystifies me: Since when do you need a port to Create a Database?
OP stated he has a Firebird-Server running, which listens on Port 3052 (instead of 3050).
You need the port to CONNECT to the Server.
Once you're connected, you can create, drop, change Databases, Tables, dirty socks, wifes, girlfriends without specifying which port
« Last Edit: November 17, 2021, 03:23:15 pm by Zvoni »
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

fcb

  • Newbie
  • Posts: 2
Re: Unit IbConnection - CreateDB
« Reply #5 on: November 18, 2021, 03:30:24 pm »
Zvoni, language please!

Sorry, marco und to OP.
Just having a bad day.....

What really mystifies me: Since when do you need a port to Create a Database?
OP stated he has a Firebird-Server running, which listens on Port 3052 (instead of 3050).
You need the port to CONNECT to the Server.
Once you're connected, you can create, drop, change Databases, Tables, dirty socks, wifes, girlfriends without specifying which port

To test, simply change the firebird server port, when trying to connect to a database that does not exist, the exception will happen, in the exception handling run the CreateDB command

Zvoni

  • Hero Member
  • *****
  • Posts: 2737
Re: Unit IbConnection - CreateDB
« Reply #6 on: November 18, 2021, 05:49:42 pm »
Does Firebird have maintenance database? Like MySQL has „mysql“?
With MySQL i always connect to that database since it exists on every server.
If FB has something similar, connect to that, and then create your DB
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

 

TinyPortal © 2005-2018