SQLitening Support Forum

SQLitening Support => You've got Questions? We've got Answers! => Topic started by: cj on March 26, 2014, 04:28:32 AM

Title: slSetProcessMods "L0" after connect failure to return to LOCAL mode
Post by: cj on March 26, 2014, 04:28:32 AM
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