I'd like to be able to get a list of all running Sybase SQL Anywhere v10-16 database servers' names (and versions).

Is there a "built in" way to do this (preferably in C#)?

I'm considering finding all running SQL Anywhere server processes and then pinvoking to pull the Caption/Window Title out of one of the process' main window (unfortunately, process.MainWindowTitle doesn't work, at least not when the server is started as hidden).

有帮助吗?

解决方案

Not in C#. There is a dblocate_servers_ex function (documentation) that you can use from a C/C++ application, or you can spawn the dblocate utility and capture the output, but that's about it.

The dblocate utility, FYI, does not make any TCP connections. It sends out broadcast packets which SQL Anywhere servers respond to, and then lists the responses.

Note that the point of the -sb 0 switch is to make it impossible to find the server using dblocate. If it were possible to find it anyway, the switch would be useless.

Full disclosure: I work for SAP in SQL Anywhere engineering.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top