Connect to excel using ADO

Source: Internet
Author: User

. Version 2
. Supports database spec
. Supports database EDB

Text 1 = "provider = Microsoft. jet. oledb.4.0; extended properties = 'excel 8.0 "+"; HDR = no; IMEX = 1; '; Data Source = "+ take the running directory () +" \ 100727 .xls ;"
'Specify the extension property as Microsoft Excel 8.0 (97) 9.0 (2000) 10.0 (2002)
'Hdr = No: no field name
'Hdr = yes: You have a field name. Generally, the column title of the first row in the Excel table is the field name, such as name and age.
'Immex indicates whether to forcibly convert to text
'Immex has three values, 0, 1, and 2, which have the following meanings:
'0 --- export mode;
'1 --- import mode;
'2 ---- connection mode (full update capability)

Debugging output (database connection 1. Connection (text 1 ))

Record set 1. Set connection (database connection 1)

Debug output (record set 1. Open ("select * from [raw data $]", # SQL statement ))

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.