C #-Excel-microsoft Access Database engine cannot find an object

Source: Internet
Author: User
Tags microsoft access database

I almost have no language, crazy, thought is office itself problem, changed many times office2007, installation and not smooth, changed to office2010, think most should be compatible with 2007, so use office2010.

Even almost give up, see a netizen said with SQL to use Excel, is preparing to new contact things. But suddenly I saw my SQL statement and suddenly thought of the "$" sign.

Error: Anunhandled exception of type ' System.Data.OleDb.OleDbException ' occurred in System.Data.dll

Additional Information:microsoft The Access database engine could not find the object "MSG". Make sure that the object exists and that its name and path name are spelled correctly. If "MSG" is not a local object, check your network connection or contact your server administrator.

This hint seems to be the path Kazakhstan or something is incorrect, the above (msg) is a sheet name in Excel. In C # I use this:

1 // this uses Excel through OLE DB. 2 string " """;

In fact it should be this:

1 // neither "[" nor "$" two symbols can be saved. 2 string " select * FROM [""$] ";

The connection string is:

1 " provider=microsoft.ace.oledb.12.0;data source= ' " " '; " ; 2 " Extended properties= ' Excel 12.0 Xml; Hdr=yes '";

C #-Excel-microsoft Access Database engine cannot find an object

Related Article

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.