Preparing for ODBC Logging

To use ODBC logging, you first create a database containing a table with the appropriate fields for the logging data. Next you use Control Panel to give the database a system Data Source Name (DSN), which is a name that the ODBC software will recognize for the database. Then you supply IIS with the name of the database and table. If a user name and password are needed for accessing the database, you must also specify these in IIS.

To prepare for ODBC logging
  1. In a database program that is ODBC-compliant (for example, Microsoft Access or Microsoft SQL Server), create a table with the following fields.
  2. Note   Included with IIS is a SQL template file which can be run in a SQL database to create a table that will accept log entries from IIS. The file is called Logtemp.sql and is available in the \IISRoot directory. If you accepted the defaults offered in Setup, the \IISRoot directory is in \WindowsRoot\System32.
    Field Name Field Type
    ClientHost varchar(255)
    Username varchar(255)
    LogTime datetime
    Service varchar(255)
    Machine varchar(255)
    ServerIP varchar(50)
    ProcessingTime int
    BytesRecvd int
    BytesSent int
    ServiceStatus int
    Win32Status int
    Operation varchar(255)
    Target varchar(255)
    Parameters varchar(255)

  3. In Control Panel, double-click ODBC and then click the System DSN tab.
  4. Click Add and then choose the driver that matches your database software.
  5. A driver-specific dialog box appears.

  6. Type a Data Source Name, and note it down for later steps. Provide other necessary information as indicated by the dialog box (for more information, click Help), then click OK until you have closed all dialog boxes.
  7. In Internet Service Manager, click the Web or FTP site for which you want ODBC logging, and open its property sheets.
  8. On the Web Site or FTP Site property sheet, make sure that the Enable Logging check box is selected, and that ODBC Logging is selected as the format.
  9. Click Properties.
  10. The ODBC Logging Properties dialog box appears.

  11. On the ODBC Properties property sheet, type the Data Source Name and the name of the table within the database. If a user name and password are required for accessing the database, type these also.
  12. Click OK until you have closed all dialog boxes.

For information about enabling or disabling logging for individual directories within the Web or FTP site, see Enabling Logging.


© 1997 by Microsoft Corporation. All rights reserved.