Import Excel sql-connect to ODBC

Source: Internet
Author: User

  1. Database connection string

    excel2000-2003: string connstr = "Microsoft.jet.oledb.4.0;data source= ' C:\Test.xls '; Extended properties=\ "Excel 8.0; Hdr=yes;imex=1\ ";";

    excel2007:string connstr = "Microsoft.ace.oledb.12.0;data source= ' c:\test.xlsx '; Extended properties=\ "Excel 12.0; Hdr=yes;imex=1\ ";";

  2. among them:

    HDR (Header Row) Settings:

    If the specified value is Yes, the first row of the worksheet in the Excel file is the field name

    If the specified value is No, the first row of the worksheet in the Excel file is information, No field name

    IMEX (IMport EXport mode) settings

    When imex=0 is "Export mode ", the Excel file opened by this mode can only be used for "write " purposes.

    & nbsp;              when imex=1 ", this mode opens excel file can only be used to do " read "use.

    When imex=2 is "connected mode ", the Excel file opened in this mode can support both "read" and " write " purposes.

Import Excel sql-connect to ODBC

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.