info("serverconnectionstatus")
info("serverconnectionstatus")

The info(“serverconnectionstatus”) function returns the status of the connection between this database and the server.

Description

This function checks the status of the connection between the current database and the server. Unlike the info(“serverconnection”) function, this function actually contacts the server to verify the connection and to verify that the server is running and that there has been no interruption in the communication session between this computer and the server. Note: Because this function does actually communicate with the server, the result may not be available instantaneously. It also consumes resources on the server, so excessive use of this function can affect server performance.

There are four possible return values for this function: empty, `ONLINE`, `OFFLINE` and `DISCONNECTED`.

If the database is a single user database (not shared), this function will return empty text (`""`). Usually there is no reason to use this function with a single user database.

The function will return ONLINE when the database has a valid, live, connection with the server. This means that everything is A-OK for shared database operations (editing data, etc.)

The function will return OFFLINE if the database isn’t currently connected to the server. For example this will occur if you’ve used the File>Disconnect from Server menu command, or if the database failed to connect to the server when it first opened. When the database is offline, the info(“serverconnectionstatus”) function doesn’t attempt to contact the server, it simply returns the OFFLINE status. If you want to find out if the server is running you can use the checkserverconnection( function. If it is running you can use the connecttoserver statement to bring the database back online.

The function will return DISCONNECTED if there is any kind of error. You’ll get this if there is a problem with your internet connection, or if there is a problem with the server (for example if the server has been turned off). The word DISCONNECTED will be followed by a colon, a space, and then the actual error message describing the problem. Here are some examples of typical results when there is a problem:

    DISCONNECTED: ERROR: Could not connect to server named Acme Company Server.
    DISCONNECTED: ERROR: Server is not available (Acme Company Server).
    DISCONNECTED: Invalid session - session 3 is not open.
    DISCONNECTED: ERROR: Server connections disabled on this client.

The first error message, Could not connect to server, occurs if there is an internet connection problem. This problem could be on your end, on the server end, or anywhere in between.

The second error message, Server is not available, will occur if the server software is not currently running on the server computer.

The third error message, Invalid session, indicates that the server software has been stopped and restarted since this database was opened on this computer.

Note: This is not a complete list of the possible error messages that may be returned by this function.

See Also

- connecttoserver -- reconnects the current database to the server (after the dropserver statement has been used).
- disconnectedserver -- takes the current database offline without contacting the server.
- dropserver -- disconnects the current database from the server.
- info("serverconnectionstatus") -- returns the status of the connection between this database and the server.
- serverdatabasename( -- returns the server database name associated with a shared database.
- servername( -- returns the name of the server associated with a shared database.
- sharedusers( -- returns a list of users that are currently using the specified database.

History

Version | Status | Notes
10.2 | New | New in this version.