If an attempt to connect fails the system is set to REMOTE mode and any attempt
to open a local database will fail unless slSetProcessMods "L0" is issued to return to LOCAL mode.
Error -18 TCP send/receive errors will be returned trying to work local if in remote mode and not connected.
#COMPILE EXE "\sql\bin\testconnect"
#INCLUDE "sqlitening.inc"
FUNCTION PBMAIN () AS LONG
slSetProcessMods "E0"
IF slConnect("bad address") THEN
? "Connected failed so change to local mode"
slSetProcessMods "L0"
ELSE
? "Connected"
END IF
IF slOpen("sample.db3") THEN
? "Database error " + slGetError
ELSE
? "Database opened"
END IF
SLEEP 5000
END FUNCTION