Not registered on the local computer "microsoft.jet.oledb.4.0

Source: Internet
Author: User

Yesterday modified a tool, the computer is running normally after compiling, but put on the server to execute but not, prompt:

Message:getoledbschematable requires an open and available Connection. The connection ' s closed

Recheck the office-related DLL files, and switch to a server with offie installed.

Check the code carefully, and found that the original segment of the exception to capture the mask off (red part):

  using(OleDbConnection oc =NewOleDbConnection (strconn)) {                if(OC. state = =connectionstate.closed) {Try{oc.                    Open (); }                     catch  (Exception ex) {  string ss = Ex.                    Message; } } DataTable schematable= OC. GetOleDbSchemaTable (System.Data.OleDb.OleDbSchemaGuid.Tables,NULL); stringTableName = schematable.rows[0][2]. ToString ().                Trim (); stringstrSQL ="Select * FROM ["+ TableName +"]"; OleDbDataAdapter ODA=NewOleDbDataAdapter (strSQL, OC); Oda.                Fill (DS); Oda.                Dispose (); Oc.            Close (); }            returnDs. tables[0];

Pit Daddy. Find the final error message: Oledbconnection.open () prompt: Not registered on the local computer "microsoft.jet.oledb.4.0

Baidu after the final solution is: at compile time to change the target CPU to x86, all OK. The reason is that when editing the default target CPU is arbitrary, but when running on a 64-bit system, it tries to use a 64-bit driver, but the system does not provide a 64-bit driver.

The middle go a lot of detours, search getoledbschematable requires an open and available Connection problem find solution not many, tried a few are white waste strength. The result is other problems.

Lessons learned: Be sure to locate the most fundamental problem, and then find a solution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.