2.3.1 Adding a Data Source Definition in Windows

Table of Contents Previous Next


2 EDB-ODBC Overview : 2.3 EDB-ODBC Connection Properties : 2.3.1 Adding a Data Source Definition in Windows

The Windows ODBC Data Source Administrator is a graphical interface that creates named data sources. You can open the ODBC Data Source Administrator (shown in Figure 2.2) by navigating to the Control Panel, opening the Administrative Tools menu, and double-clicking the appropriate ODBC Data Sources icon (32- or 64- bit).
Click the Add button to open the Create New Data Source dialog (shown in Figure 2.3). Choose EnterpriseDB (ANSI) or EnterpriseDB (UNICODE) from the list of drivers and click Finish.
If libpq is installed in the same directory as the EDB-ODBC driver, the drop-down listbox next to the SSL モード label will be active, allowing you to use SSL and other Advanced Server utilities.
Accept the default port number (5444), or enter an alternative number in the Port field.
Use the Datasource button (located in the Options box) to open the Advanced Options dialog (see Figure 2.5) and specify connection properties.
The Global button opens a dialog on which you can specify logging options for the EDB-ODBC driver (not the data source, but the driver itself).
Figure 2.5 - Page 1 of the Advanced Options dialog.
Check the box next to Disable Genetic Optimizer to disable the genetic query optimizer. By default, the query optimizer is on.
Check the box next to KSQO (Keyset Query Optimization) to enable server-side support for keyset queries. By default, Keyset Query Optimization is on.
Check the box next to Recognize Unique Indexes to force the SQLStatistics() function to report unique indexes; if the option is not checked, the SQLStatistics() function will report that all indexes allow duplicate values. By default, Recognize Unique Indexes is on.
Check the box next to Use Declare/Fetch to specify that the driver should use server-side cursors whenever your application executes a SELECT command. By default, Use Declare/Fetch is off.
Check the box next to CommLog (C:\psqlodbc_xxxx.log) to record all client/server traffic in a log file. By default, logging is off.
Check the box next to Parse Statements to specify that the driver (rather than the server) should attempt to parse simple SELECT statements when you call the SQLNumResultCols(), SQLDescribeCol(), or SQLColAttributes() function. By default, this option is off.
Check the box next to Cancel as FreeStmt (Exp) to specify that the SQLCancel() function should call SQLFreeStmt(SQLClose) on your behalf. By default, this option is off.
Check the box next to MyLog (C:\mylog_xxxx.log) to record a detailed record of driver activity in a log file. The log file is named c:\mylog_process-id.log. By default, logging is off.
The radio buttons in the Unknown Sizes box specify how the SQLDescribeCol() and SQLColAttributes() functions compute the size of a column of unknown type (see Section 3.7, Supported Data Types for a list of known data types).
Choose the button next to Maximum to specify that the driver report the maximum size allowed for a VARCHAR or LONGVARCHAR (dependent on the Unknowns as LongVarChar setting). If Unknowns as LongVarChar is enabled, the driver returns the maximum size of a LONGVARCHAR (specified in the Max LongVarChar field in the Miscellaneous box). If Unknowns as LongVarChar is not enabled, the driver returns the size specified in the Max VarChar field (in the Miscellaneous box).
Choose the button next to Don’t know to specify that the driver report a length of "unknown".
Choose the button next to Longest to specify that the driver search the result set and report the longest value found. (Note: you should not specify Longest if UseDeclareFetch is enabled.)
The properties in the Data Type Options box determine how the driver treats columns of specific types:
Check the box next to Text as LongVarChar to treat TEXT values as if they are of type SQL_LONGVARCHAR. If the box is not checked, the driver will treat TEXT values as SQL_VARCHAR values. By default, TEXT values are treated as SQL_LONGVARCHAR values.
Check the box next to Unknowns as LongVarChar to specify that the driver treat values of unknown type as SQL_LONGVARCHAR values. If unchecked, the driver will treat values of unknown type as SQL_VARCHAR values. By default, values of unknown type are treated as SQL_VARCHAR values.
Check the box next to Bools as Char to specify that the driver treat BOOL values as SQL_CHAR values. If unchecked, BOOL values are treated as SQL_BIT values. By default, BOOL values are treated as SQL_CHAR values.
Indicate the maximum length allowed for a VARCHAR value in the Max VarChar field. By default, this value is set to 255.
Enter the maximum length allowed for a LONGVARCHAR value in the Max LongVarChar field. By default, this value is set to 8190.
Specify the number of rows fetched by the driver (when UseDeclareFetch is enabled) in the Cache Size field. The default value is 100.
Use the SysTablePrefixes field to specify a semi-colon delimited list of prefixes that indicate that a table is a system table. By default, the list contains dd_;.
Click the Apply button to apply any changes to the data source properties, or the Cancel button to exit the dialog without applying any changes. Choose the OK button to apply any changes to the dialog and exit.
Select the Page 2 button (in the upper-left hand corner of the Advanced Options dialog) to access a second set of advanced options (shown in figure 2.6).
Figure 2.6 - Page 2 of the Advanced Options dialogs.
Check the box next to Read Only to prevent the driver from executing the following commands: INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, GRANT, REVOKE or LOCK. Invoking the Read Only option also prevents any calls that use ODBC’s procedure call escape syntax (call=procedure-name?). By default, this option is off.
Check the box next to Show System Tables to include system tables in the result set of the SQLTables() function. If the option is enabled, the driver will include any table whose name starts with pg_ or any of the prefixes listed in the SysTablePrefixes field of Page 1 of the Advanced Options dialog. By default, this option is off.
Check the box next to Show sys/dbo Tables [Access] to access objects in the sys schema and dbo schema through the ODBC data source. By default, this option is enabled (checked).
Check the box next to Cumulative Row Count for Insert to cause a single, cumulative row count to be returned for the entire array of parameter settings for an INSERT statement when a call to the SQLRowCount() method is performed. If this option is not enabled (the box is not checked), then an individual row count is available for each parameter setting in the array, and thus, a call to SQLRowCount() returns the count for the last inserted row.
Check the box next to LF<->CR/LF conversion to instruct the driver to convert line-feed characters to carriage-return/line-feed pairs when fetching character values from the server and convert carriage-return/line-feed pairs back to line-feed characters when sending character values to the server. By default, this option is enabled.
Check the box next to Updatable Cursors to specify that the driver should permit positioned UPDATE and DELETE operations with the SQLSetPos() or SQLBulkOperations() functions. By default, this option is enabled.
Check the box next to bytea as LO to specify that the driver should treat BYTEA values as if they are SQL_LONGVARBINARY values. If the box is not checked, EDB-ODBC will treat BYTEA values as if they are SQL_VARBINARY values. By default, BYTEA values are treated as SQL_VARBINARY values.
Check the box next to Row Versioning to include the xmin column when reporting the columns in a table. The xmin column is the ID of the transaction that created the row. You must use row versioning if you plan to create cursors where SQL_CONCURRENCY = SQL_CONCUR_ROWVER. By default, Row Versioning is off.
Check the box next to Disallow Premature to specify that the driver should retrieve meta-data about a query (i.e., the number of columns in a result set, or the column types) without actually executing the query. If this option is not specified, the driver executes the query when you request meta-data about the query. By default, Disallow Premature is off.
Check the box next to True is -1 to tell the driver to return BOOL values of True as a -1. If this option is not enabled, the driver will return BOOL values of True as 1. The driver always returns BOOL values of False as 0.
Check the box next to Server side prepare to tell the driver to use the PREPARE and EXECUTE commands to implement the Prepare/Execute model. By default, this box is checked.
Check the box next to use gssapi for GSS request to instruct the driver to send a GSSAPI connection request to the server.
Enter the database system (either EnterpriseDB or PostgreSQL) in the dbms_name field. The value entered here is returned in the SQL_DBMS_NAME argument when the SQLGetInfo() function is called. The default is EnterpriseDB.
Use the radio buttons in the Int8 As box to specify how the driver should return BIGINT values to the client. Select the radio button next to default to specify the default type of NUMERIC if the client is MS Jet, BIGINT if the client is any other ODBC client. You can optionally specify that the driver return BIGINT values as a bigint (SQL_BIGINT), numeric (SQL_NUMERIC), varchar (SQL_VARCHAR), double (SQL_DOUBLE), or int4 (SQL_INTEGER).
The default value of the Extra Opts field is 0x0 Extra Opts may be:
If set, NULL dates are reported as empty strings and empty strings are interpreted as NULL dates on input.
Determines if SQLGetInfo returns information about all tables, or only accessible tables. If set, only information is returned for accessible tables.
The Protocol box contains radio buttons that tell the driver to interact with the server using a specific front-end/back-end protocol version. By default, the Protocol selected is 7.4+; you can optionally select from versions 6.4+, 6.3 or 6.2.
The Level of Rollback on errors box contains radio buttons that specify how the driver handles error handling:
The OID Options box contains options that control the way the driver exposes the OID column contained in some tables:
Check the box next to Show Column to include the OID column in the result set of the SQLColumns() function. If this box is not checked, the OID column is hidden from SQLColumns().
Check the box next to Fake Columns to specify that the SQLStatistics() function should report that a unique index exists on each OID column.
Use the Connect Settings field to specify a list of parameter assignments that the driver will use when opening this connection. Any configuration parameter that you can modify with a SET statement can be included in the semi-colon delimited list. For example:
When you’ve defined the connection properties for the named data source, click the Apply button to apply the options; you can optionally exit without saving any options by choosing Cancel. Select the OK button to save the options and exit.
Choose the Global button (on the EnterpriseDB ODBC Driver dialog) to open the Global Settings dialog (shown in Figure 2.7). The options on this dialog control logging options for the EDB-ODBC driver. Use this dialog to enforce logging when the driver is used without a named data source, or for logging driver operations that occur before the connection string is parsed.
Check the box next to the CommLog field to record all client/server traffic in a log file. The logfile is named C:\psqlodbc_process-id where process-id is the name of the process in use.
Check the box next to the Mylog field to keep a logfile of the driver’s activity. The logfile is named c:\mylog_process-id where process-id is the name of the process in use.
When you’ve entered the connection information for the named data source, click the Test button to verify that the driver manager can connect to the defined data source (see Figure 2.8).
Click the OK button to exit Connection Test dialog. If the connection is successful, click the Save button to save the named data source. If there are problems establishing a connection, adjust the parameters and test again.

2 EDB-ODBC Overview : 2.3 EDB-ODBC Connection Properties : 2.3.1 Adding a Data Source Definition in Windows

Table of Contents Previous Next