The following tables list the fields that can be specified in an .idc file. Parameters or server variables may appear anywhere in an .idc file.
Field | Description |
---|---|
Datasource | The name that corresponds to the ODBC system Data Source Name (DSN) you created earlier by using the ODBC Administrator. |
Template | The name of the HTML extension file that formats the data returned from this query. By convention these files use the file-name extension .htx. |
SQLStatement | The SQL statement to execute. The SQL statement can contain parameter values, which must be enclosed with percent characters (%) from the client. The SQL statement can occupy multiple lines in the .idc file. Following the SQLStatement field, each subsequent line beginning with a plus sign (+) is considered part of the SQLStatement field. Multiple SQL statements can appear in the same file. |
Field | Description |
---|---|
DefaultParameters = param=value [, param=value] […] |
The parameter values, if any, that will be used in the Internet Database Connector file if a parameter is not specified by the client. |
Expires | The number of seconds to wait before refreshing a cached output page. If a subsequent request is identical, the cached page will be returned without ever accessing the database. The Expires field is useful when you want to force a requery of the database after a certain period of time. The IDC does not cache output pages by default. It caches them only when the Expires field is used. |
MaxFieldSize | The maximum buffer space allocated by the IDC per field. Any characters beyond this will be truncated. The parameter applies only to fields returned from the database that exceed 8192 bytes. The default value is 8192 bytes. |
MaxRecords | The maximum number of records that the IDC will return from any one query. The MaxRecords value is not set by default, meaning that a query can return up to 4 billion records. Set this value to limit the records returned. |
ODBCConnection | Insert this field with the value of Pool to add the connection to the connection pool, which keeps the connection to the database open for future requests. The IDC then sends data through a pooled connection for subsequent execution of an .idc file that contains the same values for Datasource, Username, and Password. Set this option to improve performance using the Internet Database Connector. Also, there is a nonpool option, which specifies that the connection for the .idc file in which this option is set should not be taken from the connection pool. Set the value of this field to NoPool to manage the cache of connections more precisely. Also, if there is a limit on the number of current connections, you do not want the connection pool to monopolize all the connections; otherwise, no one else could connect to the SQL Server. |
Password | The password that corresponds to the user name. If the password is null, this field can be left out. |
RequiredParameters | The parameter names, if any, that Httpodbc.dll will ensure are passed from the client; otherwise, it will return an error. Parameter names are separated with a comma. |
Translationfile | The path to the file that maps non-English characters (such as à, ô, or é) so that browsers can display them properly in HTML format. If the translation file is not in the same directory as the .idc file, you must type the full path to the translation file. Syntax: Translationfile: C:\directoryname\filename. Use the Translationfile field if you are publishing a database in a language other than English. A translation file is a text file with each special character mapped in the following format: value=string<CR> where value is an international character and string is the HTML translation code. |
Username | A valid user name for the data source name supplied in the Datasource field.
Note If you use Microsoft SQL Server with the integrated security option, the username and password fields in the .idc file are ignored. The logon to SQL Server is performed using the credentials of the Web user. If the request is made as the anonymous user, the username and password are determined by the settings for the anonymous user (IUSR_computername by default) in the Internet Service Manager. If the client request contained logon credentials, the username and password supplied by the end user are used to log on to SQL Server. |
Content-Type | Any valid MIME type describing what will be returned to the client. Almost always this will be “text/html” if the .htx file contains HTML. |
ODBC advanced options allow debugging and fine-tuning of the ODBC driver used by the Internet Database Connector. For more details about these options, consult your ODBC driver documentation or the ODBC Software Development Kit (SDK). The format in the IDC file is:
ODBCOptions: Option Name=Value[,Option Name=Value…]
For example, to stop the SQL statement from running for more than 10 seconds and enabling tracing of ODBC function calls, in the IDC file you would specify:
ODBCOptions: SQL_QUERY_TIMEOUT=10, SQL_OPT_TRACE=1, SQL_OPT_TRACEFILE=C:\Sql.log
Option Name | Value | Purpose |
---|---|---|
SQL_ACCESS_MODE | 0 = Read/Write
1 = Read Only. |
An indicator for the ODBC driver or data source that the connection is not required to support SQL statements that cause updates to occur. This mode can be used to optimize locking strategies, transaction management, or other areas as appropriate to the driver or data source. The driver is not required to prevent such statements from being submitted to the data source. The behavior of the driver and data source when asked to process SQL statements that are not read-only during a read-only connection is implementation-defined. SQL_ACCESS_MODE set to 0 is the default, which allows reading and writing. |
SQL_LOGIN_TIMEOUT | Integer | The number of seconds to wait for a logon request to complete before disconnecting. The default is driver-dependent and must be nonzero. If the value is 0, the timeout is disabled and a connection attempt will wait indefinitely. If the specified timeout exceeds the maximum log on timeout in the data source, the driver substitutes that value. |
SQL_OPT_TRACE | 0 = Trace off
1 = Trace on |
When tracing is on, each ODBC function call made by Httpodbc.dll is written to the trace file. You can specify a trace file with the SQL_OPT_TRACEFILE option. If the file already exists, the ODBC appends to the file. Otherwise, it creates the file. If tracing is on and no trace file has been specified, ODBC writes to the file Sql.log. |
SQL_OPT_TRACEFILE | File name | The name of the trace file to use when SQL_OPT_TRACE=1. The default is SQL.LOG |
SQL_PACKET_SIZE | Integer | The network packet size, in bytes, to be used to exchange information between the database management system (DBMS) and the Web Server.
Note Many data sources either do not support this option or can return only the network packet size. If the specified size exceeds the maximum packet size or is smaller than the minimum packet size, the driver substitutes that value. |
SQL_TRANSLATE_DLL | File name | The name of a DLL containing the functions SQLDriverToDataSource and SQLDataSourceToDriver that the driver loads and uses to perform tasks such as character-set translation. |
SQL_TRANSLATE_OPTION | Integer | Value controlling translation functionality, which is specific to the translation DLL being used. Consult the documentation for the driver and translation DLL for details. |
SQL_TXN_ISOLATION | Integer 1=Read Uncommitted 2=Read Committed 4=Repeatable Read 8=Serializable 16=Versioning |
Sets the transaction isolation level. The Internet Database Connector does not support transactions than span more than the request in the .idc file. However, for some DBMSs, setting the SQL_TXN_ISOLATION option to 1 (Read Uncommitted) will result in higher concurrency and therefore better performance. However, with this setting, data that has not been committed to the database by other transactions may be retrieved . |
SQL_MAX_LENGTH | Integer | The maximum amount of data that the driver returns from a character or binary column. This option is intended to reduce network traffic and should only be used when the data source (as opposed to the driver) in a multiple-tier driver can implement it. |
SQL_MAX_ROWS | Integer | The maximum number of rows to return for a SELECT statement. If the value equals 0 (the default), then the driver returns all rows. This option is intended to reduce network traffic when the data source itself can limit the return rows, as opposed to the MaxRecords built-in variable in the Internet Database Connector, which limits the rows fetched. |
SQL_NOSCAN | 0=Scan for and convert escape clauses
1=Do not scan for and convert escape clauses |
Specifies whether the driver does not scan SQL strings for escape clauses. If set to 0 (the default), the driver scans SQL strings for escape clauses. If set to 1, the driver does not scan SQL strings for escape clauses; instead, the driver sends the statement directly to the data source. If your SQL statement does not contain any ODBC escape clauses, a special syntax enclosed by curly braces ( { } ), then setting this option to 1 will provide a small performance gain by directing the driver to not scan the SQL string. |
SQL_QUERY_TIMEOUT | Integer
0=No timeout |
The number of seconds to wait for a SQL statement to execute before canceling the query. When set to 0 (the default) there is no timeout. If the specified timeout exceeds the maximum timeout in the data source, or is smaller than the minimum timeout, the driver substitutes that value. |
Integer | Driver Specific | Driver-specific option values can be specified in the form number=value. For example,
4322=1, 234=String |