- 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\ ";";
- 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