Microsoft KB Archive/836072

= ODBC trace is unreliable in a multithreaded IIS environment =

Article ID: 836072

Article Last Modified on 12/3/2007

-

APPLIES TO


 * Microsoft Open Database Connectivity Software Development Kit 2.5
 * Microsoft ODBC SDK
 * Microsoft Open Database Connectivity Software Development Kit 2.1
 * Microsoft Internet Information Services 6.0
 * Microsoft Internet Information Services 5.1
 * Microsoft Internet Information Services 5.0
 * Microsoft Active Server Pages 4.0

-



SYMPTOMS
If you try to trace an ODBC connection in a multithreaded Internet Information Services (IIS) environment, you may receive an empty log file, or a log file may not be created at all.



CAUSE
The multithreaded IIS environment does not support ODBC tracing.



STATUS
This behavior is by design.



Steps to reproduce the behavior
 Create a Data Source Name (DSN). To do this, follow these steps:  In Control Panel, click Administrative Tools, and then click Data Sources (ODBC). The ODBC Data Source Administrator dialog box appears. On the System DSN tab, click Add. The Create New Data Source dialog box appears. Double-click SQL Server in the Driver Name list. The Create a New Data Source to SQL Server dialog box appears. In the Name box, type.

Note is a placeholder for the system DSN. In the Description box, type the description of the data source.</li> In the Server box, type the server address or select the server that you want to connect to.</li> Click Finish, and then click OK. The DSN appears in the ODBC Data Source Administrator dialog box.</li> Click OK.</li></ol> </li> Create an Active Server Pages (ASP) page. To do this, follow these steps: <ol style="list-style-type: lower-alpha;"> Create a folder on the desktop of your computer, and then name the folder MyWeb.</li>  Paste the following code in Notepad: <HTML> <HEAD><TITLE>ASP Database Connection</TITLE></HEAD> <BODY BGCOLOR=white> <H1>Northwind Database Contacts</H1> <% Dim Connect, selectSQL, RecSet Set Connect = CreateObject (&quot;ADODB.Connection&quot;) Connect.Open &quot;DSN= &quot; selectSQL = &quot;SELECT * FROM Customers&quot; Set RecSet = Connect.Execute (selectSQL) If NOT RecSet.EOF THEN DO UNTIL RecSet.EOF Response.Write RecSet(&quot;Companyname&quot;) & &quot;, &quot; & RecSet(&quot;Contactname&quot;) & &quot;<BR><BR>&quot; RecSet.MoveNext Loop End If RecSet.Close Connect.Close Set RecSet = Nothing Set Connect = Nothing %> </BODY></HTML> </li> Name this file myWeb.asp, and then save it in the MyWeb folder.</li></ol> </li> Create a virtual directory. To do this, follow these steps: <ol style="list-style-type: lower-alpha;"> Click Start, and then click Run. The Run dialog box appears.</li> In the Open box, type inetmgr, and then click OK. The Internet Information Services window appears.</li> Double-click  .

Note is a placeholder for the name of the server.</li> Expand Web Sites under  , right-click Default Web Site, point to New, and then click Virtual Directory.</li> In the Virtual Directory Creation Wizard, click Next.</li> In the Alias box, type, and then click Next.

Note is a placeholder for the virtual directory that you create on your computer that is running Internet Information Services.</li> Click Browse, locate the MyWeb folder that you created on the desktop, and then click Next.</li> Verify the access permissions, and then click Next.</li> <li>Click Finish to create the virtual directory.</li></ol> </li> <li>Trace the ODBC connection. To do this, follow these steps: <ol style="list-style-type: lower-alpha;"> <li>In Control Panel, click Administrative Tools.</li> <li>Click Data Sources (ODBC), and then click the Tracing tab.</li> <li>In the Log file Path box, type C:\ to create a log file.

Note is a placeholder for the log file that the computer creates to log the results when you connect to the database through a program.</li> <li>Click Start Tracing Now and do not close the ODBC Data Source Administrator dialog box.</li> <li>Open the myWeb.asp file in Internet Explorer.</li> <li>After the page is loaded, click Stop Tracing Now in the ODBC Data Source Administrator dialog box.</li> <li>Open the  log file. You find the result that is mentioned in the &quot;Symptoms&quot; section.</li></ol> </li></ol>

Keywords: kbuser kbiisam kbaspobj kbprb KB836072

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.