How to make a DSN-less connection for ODBC into Reality

Follow the information given below for ODBC API calls.

A connection string for Reality looks like the following…
“DRIVER=RealSQL Driver 32bit;System=Personnel;Account=LIVE-DATA;UID=tom;PWD=1q4ftH”
Note: If the Account contains a password, the following keyword should be added “AccPswd=+q93Ngl”

ODBC connection details are normally stored in one of three types of DSNs: File, System, or User. Each DSN type has a different level of security profile; File being the lowest and User being the highest. The ODBC connection requires a “System” entry, on Reality this refers to an entry in the  winsni.ini file, each entry contains host and dbase information. Other important connection parameters such as user and account details are stored in the DSN.

ODBC supports three API calls, which are used to make connections:
Note: Reality supports the first two, but not the last, SQLBrowseConnect.

  1. SQLConnect: is the simplest connection function. It requires a data source name and accepts an optional user ID and password.
    For more info refer to: http://msdn.microsoft.com/en-us/library/ms711810.aspx
  2. SQLDriverConnect: is used to connect to a data source using a connection string
    For more info refer to: http://msdn.microsoft.com/en-us/library/ms715433.aspx
  3. SQLBrowseConnect: like SQLDriverConnect, uses a connection string. However, by using SQLBrowseConnect, an application can construct a complete connection string at run time.

Further Information:
It may also be worth looking at the Reality SQL Software readme (the latest version is on the Reality Installation Menu) and source file RealDbTest for an example of a DSN-less connection.

Back to articles