Connection string:
Adoconnection1.connectionstring: = 'provider = Microsoft. Jet. oledb.4.0; Data Source = '+
Edit1.text + '; extended properties = "Excel 8.0; IMEX = 1; HDR = yes"; persist Security info = true ';
1. The extended attributes in the Excel connection string must contain IMEX = 1;
2. Modify the value of HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ jet \ 4.0 \ engines \ Excel \ typeguessrows in the Registry to 0. The default value of typeguessrows is 8, which indicates that the system samples the data type from the first eight rows of data in the file. If the first eight rows contain numbers and text, the Data Type of the sample is large. For example, if the first eight rows contain 5 rows of numbers and 3 rows of text, 5 rows of numbers are returned, and 3 rows are empty. If there are four rows of numbers and four lines of text, four rows of numbers are returned. The four rows are empty. If the data types after 8 rows are the same as those of the sampling type, the actual data is returned. Otherwise, null is returned.