When Excel is operated in oledb or ODBC mode, "Update Not Allowed" is displayed. The database or object is read-only"

Source: Internet
Author: User
Tags odbc connection
Recently, we have imported the datatable content to excel. If the specified Excel file does not exist, it is automatically created.
Corresponding connection string:
Oledb connection string: "provider = Microsoft. Jet. oledb.4.0; Data Source = c: \ test. XSL; extended properties = Excel 8.0"
ODBC connection string: "Driver ={{ Microsoft Excel Driver (*. XLS) }}; DSN = ''; readonly = false; create_db = \" C: \ test. XSL \ "; DBQ = c: \ test. XSL"
When open () is enabled, this error is reported: "cannot be updated. The database or object is read-only"

Note that no. The data file c: \ test in the above two connection strings. XSL, It is easy to confuse, changed to c: \ test. XlsWhen open () is executed, test.xls is created under c: \. Of course, if it is in another folder, make sure that the folder is Excel ProgramShould have the write permission.

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.