OLE DB ASP.NET 2.0 MySQLProv provider with gives error -2147467259 - No error message available, result code: E_FAIL(0x80004005).

Posted on 2007-10-16
Last Modified: 2013-12-17
ASP.NET 2.0 running on an xp workstation with the latest of the MySQLProv installed.
trying to access a MySQL  database on a windows server 2000
By using an oLEDB connection with MySQLProv installed on workstation..

connectionString="location=server_name;data source=db_name;Provider=MySQLProv;uid=usern_name;password=pwd;port=3306;

Receive the error below when I do a .open on the olebd connection object.

-2147467259 - No error message available, result code: E_FAIL(0x80004005).

Any help to use OLE DB *not* odbc would be greatly appreciated....

                using (OleDbConnection oleCon = new OleDbConnection(sConnect))
                    oleCon.Open();  <---- throws the exception
                    using (OleDbCommand comAdmin = new OleDbCommand(sSQL, oleCon))
                        OleDbDataReader dr = comAdmin.ExecuteReader();
                        if (!dr.HasRows)
                            lblMsg.Text = "Password is incorrect.  Please try again";
            catch (OleDbException oExecption)
                lblMsg.Text = oExecption.ErrorCode + " - " + oExecption.Message;
Question by:angelalaw
    LVL 22

    Expert Comment

    Do you have read/write permissions for the DB, and containing folder?

    Looks like a permissions issue.


    Author Comment

    Hi RedKelvin,

    I understand your point... But wouldn't it be able to read regardless of the permissions?  it is not requesting a specific file like in Microsoft Access.  Rather it is looking to the server to find the MySql service to access a database given.

    Aside from that right now they use TOAD to hand edit the database and I am building a web app so non-techie people can do the edits for the intranet..And they have no problem doing this.  And again TOAD does not asking for a specific file (like with Access) rather it is looking for the MYSQL Service to link to, inorder to gain access...

    Any other thoughts...I have to give a qoute on work....but it is difficult if I don't know if I am going to have to rebuild from scratch or if I can simply use the existing database...

    Yours in deepest gratitude,

    Angela Law
    LVL 22

    Expert Comment

    Ensure that your username and password are correct.

    Is the db on the same server as the app, wondering if it may be a firewall/port issue
    LVL 3

    Expert Comment

    I'd have to agree with RedKelvin, this looks like the connection is never established to begin with.  Is the service is "discoverable" from the server running your web app?  This may point to connection issues like firewalls, port filtering, or even the database answering on a non-standard port.  If it is, then you can start tracking down an authentication issue (security context, any impersonation, etc.), but from the error I'd guess it's not making it that far.
    LVL 15

    Expert Comment

    See this related thread but with Microsoft Access:

    Author Comment

    Hi everyone,

    Thank you for taking the time to reply.  However, what i said in my last email was correct.

    The answer is the MySQLProv driver I downloaded, I do not think it works atleast with .NET 2.0....

    So, I went to Cherry City Software

    Downloaded and installed their driver.

    And it worked right off the bat...Plus it had examples and very good documentation...

    So, it just looks like the MySQLProv driver is not compatible with .NET 2.0...

    Thanks again for you taking the time to try and help me figure this out....


    Angela Law
    LVL 1

    Accepted Solution

    PAQed with points refunded (500)

    EE Admin

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
    Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    729 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

    18 Experts available now in Live!

    Get 1:1 Help Now