SqlSetLFallback

Indicates that SqlOpen can connect to a fallback server if an attempt to connect to a primary server fails.

Syntax

SqlSetLFallback& ( loginrec&, status$ );

where

loginrec&
Is a pointer to a LOGINREC structure, which is passed as a parameter to SqlOpen.
status$
Specifies whether fallback support is enabled or not. Set status$ to "ON" to enable fallback support. Set status$ to "OFF" to disable fallback support.

Returns

SUCCEED or FAIL.

Remarks

Call the SqlSetLFallback function to indicate that a fallback server can be used by a subsequent call to SqlOpen. When successfully connected to the primary server, the SqlOpen function automatically determines the current fallback server and verifies that the fallback information is stored in the registry. You must call the SqlSetLFallback function before you call the SqlOpen function. If the attempt to connect to the primary server fails, SqlOpen attempts to connect to the fallback server.

The status$ setting determines whether fallback support is available during subsequent calls to SqlOpen.

For SqlSetLFallback to function properly, the connection timeout set by calling SqlSetLoginTime must be a value greater than 0.

Example

In this example, SqlSetLFallback specifies that fallback support is enabled prior to a call to SqlOpen.

SqlSetLFallback(Loginrec, "ON")
Sqlconn = SqlOpen(Loginrec, "my_server")