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.
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.