Microsoft Knowledge Base Email Alertz

KBAlertz.com: (830133) - If you connect to a Microsoft Access database and then you create more than 64 connections in one process, you may receive one of the following error messages: In Microsoft Visual Studio .NET: Unspecified error In Microsoft Visual Basic 6.0, if you...

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]

Search KbAlertz

Advanced Search

Webmasters
Put kbAlertz on your website.
[ Click Here for more! ]





ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **


Bug Tracking Software
For bug tracking software or defect tracking software or issue tracking software, visit Axosoft.


Community Site



We Send hundreds of thousands of emails using ASP.NET Email



Expert Web Design & Graphic Design
Design44.com

ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **




Mentioned In








Microsoft Knowledge Base Article

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




Article ID: 830133 - Last Review: January 19, 2007 - Revision: 3.0

You receive an "unspecified error" error message when you create more than 64 connections to an Access Database in one process

On This Page

SYMPTOMS

If you connect to a Microsoft Access database and then you create more than 64 connections in one process, you may receive one of the following error messages:
  • In Microsoft Visual Studio .NET:
    Unspecified error
  • In Microsoft Visual Basic 6.0, if you use ActiveX Data Objects (ADO):
    Runtime-Error '-2147467259 (80004005)': Unspecified Error

STATUS

This behavior is by design.

MORE INFORMATION

Steps to reproduce the behavior

  1. Start Visual Studio .NET.
  2. Use Microsoft Visual C# .NET or Microsoft Visual Basic .NET to create a new Console Application project. Name the project AccessApplication. By default, Class1.cs (in Visual C# .NET) or Module1.vb (in Visual Basic .NET) is created.
  3. In Class1.cs or in Module1.vb, replace the existing code with following code.

    Note To use this sample code, change the Data Source path to the path of any Microsoft Access database file that is on your computer.

    Visual C# .NET Code
    using System;
    using System.Data.OleDb;
    
    namespace AccessApplication
    {
    	/// <summary>
    	/// Summary description for Class1.
    	/// </summary>
      class Class1
      {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main(string[] args)
        {
          //
          // TODO: Add code to start application here
          //
          int intCount;
          int intMaxConnections;
          string strConnection;
    
          intMaxConnections = 65;
          object[] objArray = new object[intMaxConnections];
    
          strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" + 
            "Data Source=C:\\Program Files\\Microsoft Office\\Office10\\Samples\\Northwind.mdb;";
    			        
          Console.WriteLine("Starting test...");
    			
          for (intCount=0;intCount<intMaxConnections;intCount++)
          {
            try
            {
              OleDbConnection myConnection = new OleDbConnection(strConnection);
              myConnection.Open();
              Console.WriteLine("Open connection is " + intCount);
              objArray[intCount] = myConnection;
            }
            catch(Exception excpt)
            {
              Console.WriteLine("Exception : " + excpt.Message.ToString());
            }
          }
        }        
      }
    }
    
    Visual Basic .NET Code
    Imports System.Data.OleDb
    Module Module1
    
      Sub Main()
        Dim intCount As Integer
        Dim intMaxConnections As Integer
        Dim strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" _
            & "Data Source=C:\Program Files\Microsoft " _
            & "Office\Office10\Samples\Northwind.mdb;"
    
        intMaxConnections = 65
    
        Dim IntArray(intMaxConnections) As Object
        Console.WriteLine("Starting test...")
        For intCount = 0 To intMaxConnections
          Try
            Dim objConnection As New OleDbConnection(strConnection)
            objConnection.Open()
            Console.WriteLine("Open connection is " & intCount)
            IntArray(intCount) = objConnection
          Catch excpt As Exception
            Console.WriteLine("Exception " + excpt.Message.ToString())
          End Try
        Next
      End Sub
    
    End Module
    
  4. On the Debug menu, click Start.

REFERENCES

For more information about how to open an Access database by using ADO, visit the following Microsoft Developer Network (MSDN) Web site:
http://msdn2.microsoft.com/en-us/library/aa141406(office.10).aspx (http://msdn2.microsoft.com/en-us/library/aa141406(office.10).aspx)

APPLIES TO
  • Microsoft Access 2002 Standard Edition
  • Microsoft Access 2000 Standard Edition
  • Microsoft Access 97 Standard Edition
Keywords: 
kberrmsg kbprb kbdatabase KB830133
       

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

Be the first to leave feedback, to help others about this knowledge base article.

(Optional) Name

(Optional) Public URL Or Email

Comments
No HTML -- Text Only Please