|
 |
 |
 |
 |
Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms
of Use |
Trademarks
Article ID: 836072 - Last Review: December 3, 2007 - Revision: 1.3 ODBC trace is unreliable in a multithreaded IIS environmentIf 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. The multithreaded IIS
environment does not support ODBC tracing. 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
mydatasource.
Notemydatasource is a placeholder
for the system DSN. - In the Description box, type the
description of the data source.
- In the Server box, type the server
address or select the server that you want to connect to.
- Click Finish, and then click
OK. The DSN appears in the ODBC Data
Source Administrator dialog box.
- Click OK.
- Create an Active Server Pages (ASP) page. To do this, follow these steps:
- Create a folder on the desktop of your computer, and then name the folder MyWeb.
- 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 ("ADODB.Connection")
Connect.Open "DSN=<mydatasource>"
selectSQL = "SELECT * FROM Customers"
Set RecSet = Connect.Execute (selectSQL)
If NOT RecSet.EOF THEN
DO UNTIL RecSet.EOF
Response.Write RecSet("Companyname") & ", " & RecSet("Contactname") & "<BR><BR>"
RecSet.MoveNext
Loop
End If
RecSet.Close
Connect.Close
Set RecSet = Nothing
Set Connect = Nothing
%>
</BODY></HTML> - Name this file myWeb.asp, and then save it in
the MyWeb folder.
- Create a virtual directory. To do this, follow these steps:
- Click Start, and then click
Run. The Run dialog box appears.
- In the Open box, type inetmgr, and then click OK. The Internet
Information Services window appears.
- Double-click servername.
Noteservername is a placeholder for
the name of the server. - Expand Web Sites under servername, right-click
Default Web Site, point to New, and then
click Virtual Directory.
- In the Virtual Directory Creation
Wizard, click Next.
- In the Alias box, type
foldername, and then click
Next.
Notefoldername is a placeholder for
the virtual directory that you create on your computer that is running Internet
Information Services. - Click Browse, locate the MyWeb
folder that you created on the desktop, and then click
Next.
- Verify the access permissions, and then click
Next.
- Click Finish to create the virtual
directory.
- Trace the ODBC connection. To do this, follow these steps:
- In Control Panel, click
Administrative Tools.
- Click Data Sources (ODBC), and then
click the Tracing tab.
- In the Log file Path box, type
C:\Sql.log to create a log file.
NoteSql.log is a placeholder
for the log file that the computer creates to log the results when you connect
to the database through a program. - Click Start Tracing Now and do not
close the ODBC Data Source Administrator dialog
box.
- Open the myWeb.asp file in Internet Explorer.
- After the page is loaded, click Stop Tracing Now in the ODBC Data Source
Administrator dialog box.
- Open the Sql.log log file. You find the result that is mentioned in the "Symptoms"
section.
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 version 5.1
- Microsoft Internet Information Services 5.0
- Microsoft Active Server Pages 4.0
| kbaspobj kbuser kbiisam kbprb KB836072 |
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate
|
 |
 |
 |
 |
 |
 |
 |
| |