Data Source Name Connection String Keywords
A connection string used to connect to a DSN may include any number of driver-defined keywords. Using these keywords, the driver has enough information to connect to the data source. The driver defines which keywords are required to connect to the data source.
See ODBC Connection Strings for a complete discussion of PSQL connection strings and the keywords.
Closing an Open Table
Calling SQLFreeStmt with the SQL_CLOSE option changes the SQLState but does not close the open tables used by the hStmt. To close the tables currently used by hStmt, SQLFreeStmt must be called with the SQL_DROP option.
In the following example, the Emp and Dept tables remain open:
SQLPrepare(hStmt, “SELECT * FROM Emp, Dept”, SQL_NTS)
SQLExecute(hStmt)
SQLFetch until SQL_No_Data_Found
SQLFreeStmt(hStmt, SQL_CLOSE)
When SQLPrepare is subsequently called on the hStmt, the tables used in the previous statement are closed. For example, when the following call is made, both the Emp and Dept tables are closed by PSQL:
SQLPrepare(hStmt, “SELECT * FROM Customer”,SQL_NTS)
The following call would then close the table Customer:
SQLFreeStmt(hStmt, SQL_DROP)