Microsoft Knowledge Base Email Alertz

(313883) - An approximately 4-kilobyte (KB) memory leak is encountered when you use Microsoft Windows NT 4.0 Service Pack 6a (SP6a) to load and unload Microsoft SQL Server client components (the ODBC driver or OLE DB provider). The following Visual Basic code...

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 313883 - Last Review: February 22, 2007 - Revision: 3.2

BUG: Memory Leak When You Load and Unload the SQL Server ODBC Driver or OLE DB Provider

This article was previously published under Q313883

SYMPTOMS

An approximately 4-kilobyte (KB) memory leak is encountered when you use Microsoft Windows NT 4.0 Service Pack 6a (SP6a) to load and unload Microsoft SQL Server client components (the ODBC driver or OLE DB provider). The following Visual Basic code produces this behavior:
Public Sub Main()
   Dim cn as ADODB.Connection

   While (1)
      Set cn = New ADODB.Connection
      cn.Open "Driver={SQL Server};SERVER=myserver;DATABASE=mydb;UID=GuestAccount"
      cn.Close
      Set cn = Nothing
   Wend
End Sub
				

CAUSE

This behavior is caused by a low-level system leak. It occurs only during the loading and unloading of the Dbnetlib.dll file.

RESOLUTION

If you must run your application on Windows NT 4.0 SP6a, it is recommended that you ensure that one of the following conditions is true:
  • An open connection is maintained for the duration of the application.

    -or-
  • You call the Win32 API LoadLibrary function to load Dbnetlib.dll, and keep it loaded for the duration of the application.
NOTE: When you turn on ODBC connection pooling or OLE DB resource pooling for the application, this lessens the amount of leakage, because connections are pooled and left open even though the application has closed the connection.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

This issue does not occur on Microsoft Windows 2000 or Microsoft Windows XP-based systems.

APPLIES TO
  • Microsoft OLE DB Provider for SQL Server 2000 2000.80.194
  • Microsoft OLE DB Provider for SQL Server 2000 2000.80.380.0
  • Microsoft OLE DB Provider for SQL Server 2000 2000.81.7713.0
  • Microsoft ODBC Driver for SQL Server 2000 2000.80.194
  • Microsoft ODBC Driver for SQL Server 2000 2000.80.380
  • Microsoft ODBC Driver for SQL Server 2000 2000.81.7713.0
  • Microsoft Windows NT 4.0
  • Microsoft Windows NT 4.0 Service Pack 6a
Keywords: 
kbbug KB313883
       

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