WSODBC Example

The following is an example of how WSODBC can be used in a WS script.

The following files are from an example for using wsodbc in a real-world situation. In this case, we will be connecting to multiple databases, which are located on three different servers. As best practice suggests, we have stored our functions in a separate file for ease of maintenance and the main processes are contained in a different file. The files included are as follows.

dbo.sjs

This file contains the global variables and the main functions of the ODBC operation. The included functions are as follows.

  • ODBCconnect(dbase)
  • opendb()
  • closedb()
  • userTable(dbase)
  • dbTableCreate()
FUNCTIONS_ELOGON.sjs

This script file contains the functional scripts for the ODBC operation. These functions will be called from the main script. The functions contained within are ,listed below.

  • set_device(param)
  • checkUser()
  • changeLayout()
  • addUser()
  • changePassword()
  • searchUser()
  • modifyUser()
  • lockUserToggle(param)
  • resetPassword()