Microsoft. Ace. oledb.12.0

Source: Internet
Author: User

SetCodeDeploy it on the test machine because oledb is used to operate Excel,ProgramThe following error occurs:

 System. invalidoperationexception: the 'Microsoft. Ace. oledb.12.0 'provider is not registered on the local machine.
At system. Data. oledb. oledbserviceswrapper. getdatasource (oledbconnectionstring constr, datasourcewrapper & datasrcwrapper)
At system. Data. oledb. oledbconnectioninternal .. ctor (oledbconnectionstring constr, oledbconnection connection)
At system. Data. oledb. oledbconnectionfactory. createconnection (dbconnectionoptions options, object poolgroupproviderinfo, dbconnectionpool pool, dbconnection owningobject)
At system. Data. providerbase. dbconnectionfactory. createnonpooledconnection (dbconnection owningconnection, dbconnectionpoolgroup poolgroup)
At system. Data. providerbase. dbconnectionfactory. getconnection (dbconnection owningconnection)
At system. Data. providerbase. dbconnectionclosed. openconnection (dbconnection outerconnection, dbconnectionfactory connectionfactory)
At system. Data. oledb. oledbconnection. open ()
At system. Data. Common. dbdataadapter. fillinternal (Dataset dataset, datatable [] datatables, int32 startrecord, int32 maxrecords, string srctable, idbcommand command, commandbehavior behavior)
At system. Data. Common. dbdataadapter. Fill (Dataset dataset, int32 startrecord, int32 maxrecords, string srctable, idbcommand command, commandbehavior behavior)
At system. Data. Common. dbdataadapter. Fill (Dataset dataset)

 

The connection code is as follows:

 
Provider = Microsoft. Ace. oledb.12.0; Data Source = {0}; Excel 12.0 XML; HDR = yes;

After the preceding error occurs, install a component. If not, set IIS.

Because Microsoft Office is not installed on the server, a package named accessdatabaseengine.exe is downloaded from the official website.

Instructions:

This download will install a set of components that facilitate the transfer of data between existing Microsoft Office files such as Microsoft Office Access 2007 (*. MDB and *. accdb) files and Microsoft Office Excel 2007 (*. xls ,*. XLSX, and *. xlsb) files to other data sources such as Microsoft SQL Server. connectivity to existing text files is also supported.

 

After the installation is complete, you also need to configure an attribute in the IIS connection pool:

Open IIS --> Find the application pool corresponding to the website --> advanced settings --> General --> enable the 32-bit application with the value true.

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.