DBSETLFALLBACK

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

Syntax

RETCODE DBSETLFALLBACK (
PLOGINREC
ploginrec,
LPCSTR
pstatus );

where

ploginrec
Is a pointer to a LOGINREC structure, which is passed as a parameter to dbopen.
pstatus
Specifies whether fallback support is enabled or not. Set pstatus to "ON" to enable fallback support. Set pstatus to "OFF" to disable fallback support.

Returns

SUCCEED or FAIL.

Remarks

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

Setting pstatus to "ON" or "OFF" determines whether fallback support is available during subsequent calls to dbopen.

For DBSETLFALLBACK to function properly, the connection timeout set by calling dbsetlogintime or DBSETLTIME must be a value greater than 0.

Example

In this example, DBSETLFALLBACK specifies that fallback support is enabled prior to a call to dbopen.

DBSETLFALLBACK(loginrec, "ON");
dbproc = dbopen(loginrec, "my_server");