Restart Firebird by code Delphi

129 views
Skip to first unread message

Learn Softwares

unread,
Feb 9, 2024, 4:41:34 AM2/9/24
to firebird-support
how can i restart firebird by code Delphi?

Mark Rotteveel

unread,
Feb 9, 2024, 4:50:08 AM2/9/24
to firebird...@googlegroups.com
On 09/02/2024 10:41, Learn Softwares wrote:
> how can i restart firebird by code Delphi?

You can't, or at least, there is nothing specifically in Firebird to do
that. You would need to call the right Windows API or commandline
operation of Windows to restart the service (assuming Firebird is even
running as a service). And if Firebird is hosted on a different
computer, this will be even more complicated.

Mark
--
Mark Rotteveel

Elmar Haneke

unread,
Feb 9, 2024, 4:52:35 AM2/9/24
to firebird...@googlegroups.com

how can i restart firebird by code Delphi?

you have to stop and start the firebirdsql service, e.g. by invoking the "net stop ..." and "net start ..." commands.

Elmar

Dimitry Sibiryakov

unread,
Feb 9, 2024, 5:38:16 AM2/9/24
to firebird...@googlegroups.com

Stefan Heymann

unread,
Feb 9, 2024, 8:18:31 AM2/9/24
to firebird...@googlegroups.com
> how can i restart firebird by code Delphi?

There is a ServiceManager unit source code here:

https://stackoverflow.com/questions/5913279/detect-windows-service-state/5917648

This is a wrapper for the WinSvc unit of Delphi. You can use that to enumerate, start, and stop services.


Best Regards

Stefan



--
Stefan Heymann, Tübingen, Germany

Learn Softwares

unread,
Feb 10, 2024, 8:17:38 AM2/10/24
to firebird...@googlegroups.com
i could not understand...

i just want to know how to start or stop firebird by code in Delphi...

could you help me?

Rones.

--
You received this message because you are subscribed to the Google Groups "firebird-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-suppo...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/firebird-support/1112777739.20240209141827%40stefanheymann.de.


--

Atenciosamente,

Learn Softwares ®

Dimitry Sibiryakov

unread,
Feb 10, 2024, 8:27:07 AM2/10/24
to firebird...@googlegroups.com
Learn Softwares wrote 10.02.2024 14:17:
> i just want to know how to start or stop firebird by code in Delphi...

In this case could you explain what do you call "firebird", please?

All answers were based on an assumption that you want to start or stop
Firebird SQL server installed as a service on Windows. If you have something
different on mind - they are not applicable, indeed.

--
WBR, SD.

Elmar Haneke

unread,
Feb 12, 2024, 4:13:36 AM2/12/24
to firebird...@googlegroups.com


Am 10.02.24 um 14:17 schrieb Learn Softwares:
i could not understand...

i just want to know how to start or stop firebird by code in Delphi...

could you help me?


There is no option to do that part of firebird client code.

Do to that, you have to restart the FirebirdSQL Windows-Service (assuming you are not using an Linux-Delphi).

Restarting service can be done from command line (net start / net stop) or by using Windows API.

The ServiceManager unit should be an Wrapper for the API.

As an alternative, you can use the "system" command to start the command to be entered on Command line.

hamacker

unread,
Feb 14, 2024, 12:43:29 PM2/14/24
to firebird...@googlegroups.com
It's not easy,

You need admin permission (aka elevation) to perform:
sc \\myserver restart FirebirdServiceName

When 'sudo' came to Windows, maybe it was easy.



Em sex., 9 de fev. de 2024 às 06:41, Learn Softwares <lojalea...@gmail.com> escreveu:
how can i restart firebird by code Delphi?

--
You received this message because you are subscribed to the Google Groups "firebird-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-suppo...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages