Solved : OleDbException (0x80004005): Unspecified error

Posted on 2005-04-12
Last Modified: 2008-01-09
I am trying to connect to an access database
with an application
here is the code (

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim sConStr, sSql, DelSql, InsSql, UpSql As String
        sConStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\backup\temp\pinkas_be.mdb;Persist Security Info=False"
        sSql = "Select * from area_table order by area_name"

        Dim objConn As New OleDb.OleDbConnection(sConStr)
        Dim objDataAdapter As New OleDb.OleDbDataAdapter(sSql, objConn)
        Dim objDs As New DataSet
        DataGrid1.DataSource = objDs
    End Sub
the exception occurs in the objConn.Open() line:
OleDbException (0x80004005): Unspecified error

what could be the problem?
Question by:hagitsh
    LVL 1

    Expert Comment

    Do the following:

    Put the code in try catch block.
    Try to to assign command and connection to adapter in step by step
    not in a single step which u have done in this code
    and then debug the function line by line
    U will be able to find the error

    if the above steps not able to solve the problem

    The error could be the version of jet provider u r using.
    Try to use the latest version of provider.

    Happy coding
    LVL 1

    Accepted Solution


    OleDbException (0x80004005): Unspecified error

    this is usually a permission problem.
    change your connection string to:-

    sConStr = "Provider=Microsoft.Jet.OLEDB.4.0;data source=C:\backup\temp\pinkas_be.mdb" '<- that's all you need
    and ensure that IUSR_[compname] user account has access to the database as this is the user IIS will be using to poll the DB.

    LVL 4

    Expert Comment

    Or you could try using a previous version of JET i use SQL server personally.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    bigDiff challenge 17 60
    thread-safe code in c++ 2 59
    Replace a tag with sed 2 32
    mapAB Challlenge 35 55
    Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
    Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now