Hello CharlyTango,
CharlyTango wrote: ↑28.12.2022, 17:44
Hi,
after some research i found the possibility in one of the zeos examples to ask ZEOS which protocols are supported.
Code: Select all
Drivers := DriverManager.GetDrivers;
for I := 0 to Drivers.Count - 1 do
begin
Protocols := (Drivers.Items[I] as IZDriver).GetSupportedProtocols;
IZDriver.
for J := 0 to High(Protocols) do
ZProtocol.Items.Add(Protocols[J]);
end;
There is a more simple way. This is what I do:
Code: Select all
ZConnection.GetProtocolNames(ProtocolsCB.Items);
This will ask the TZConnection object ZConnection to put all supported protocols in the TSTrings property Items of the ProtocolsCB combo box. But you can fill any TStrings descandant.
CharlyTango wrote: ↑28.12.2022, 17:44
But i had not found any possibility to ask ZEOS for
standard names of the supported connection libraries and
standard ports.
There really isn't a way to ask that to the driver.
Short answer:
What would you do with that information? Setting the port number to 0 will tell Zeos to use the default port. And keeping the library name empty will tell Zeos to just try the default library names.
Long answer:
Port numbers: Providing this kind of information may lead to wrong assumptions on the users side. Assume the following: In most cases Firebird uses Port 3050. But there also is the possibility to change that in the configuration files. So maybe an admin has good reason to set the default port to 3501 on some machine.
Now assume that Zeos provides information about the default port number (3050) and a user thinks "Oh fine, let's just always put that into the port property of my TZConnection object." And now we start overriding port number set by the admin (3051) with the default port number pulled from some Zeos interface (3050). And the user will have a hard time in finding the error.
Things can get more compilcated: MS SQL Server has a way to run several instances on one computer and they are not distinguished by port numbers but by names in the first place. There it is the task of the client library to find out the correct port number.
And as far as I can tell, the oracle driver doesn't even use the port number at all.
connection libraries: When it comes to libraries there is even more to think about: What help is getting the library names to you? Each driver has a built in list of library names. But that doesn't mean that libraries which are not on that list are not supported. It just means that nobody added them. Zeos will try each of these libraries in turn if you don't provide a library name.
With best regards,
Jan