info("serverconnection")
info("serverconnection")

The info(“serverconnection”) function returns true if the currently active database successfully connected to the server when it opened.

Description

The info(“serverconnection”) function returns true if the currently active database successfully connected to the server when it opened. If the database failed to connect to the server (perhaps the server is unavailable at that moment), or if it is not a shared database, it returns false.

> IMPORTANT: This function does not actually verify that there is a working connection between this computer and the server, or that the server itself is working. If you want to do that, use the info(“serverconnectionstatus”) function.

This example displays a message and stops if the current database isn’t currently connected.

    if info("serverconnection")=false()
        message "Database is open but not connected to the server."
        return
    endif
    ...
    ... more code here
    ...

Note: Another way to find out if a database is currently connected is to use the dbinfo( function. This function can find out if any open database is connected, not just the current database.

    if dbinfo("connected","Checkbook")=false()
        message "Checkbook is not connected to the server."
        return
    endif

See Also

- connecttoserver -- reconnects the current database to the server (after the dropserver statement has been used).
- 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 | No Change | Carried over from Panorama 6.0