将Excel文件获取到Sql2008 [英] Get Excel Files To Sql2008

查看:72
本文介绍了将Excel文件获取到Sql2008的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个excel文件,像这样的sheet1格式
A B C D E F G H I
1 02:00
2 16:00
3小时3
4 0.124
5 0.234

E1 && E2单元格格式为datetime,但E3,E4,E5为字符串,
当我使用oledb连接器将此工作表读取到数据库时,数据格式转换出现这样的错误
a b c d e
02:00
16:00
NULL
1899/01/01 01:24
1899/01/01 02:34

连接字符串为
Provider = Microsoft.ACE.OLEDB.12.0;数据源= F:\ XBoxProgram \ MESD \ DataFormat \ CH350-40023 _16.00_H5-H6.xls;扩展属性="EXCEL 12.0; HDR = NO; IMEX = 1";
我拥有IMEX = 1,但是无法将真实数据吸引到数据库
如何将真实数据获取到数据库?
excel文件是Excel2007 sava,格式为Excel97-2003

I hava a excel file ,the sheet1 format like this
A B C D E F G H I
1 02:00
2 16:00
3 h3
4 0.124
5 0.234

The E1 && E2 cells format is datetime ,but the E3,E4,E5 is string,
when i using oledb connector read this sheets to database ,the data format convert was error like this
a b c d e
02:00
16:00
NULL
1899/01/01 01:24
1899/01/01 02:34

the connectionstring is
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=F:\XBoxProgram\MESD\DataFormat\CH350-40023 _16.00_H5-H6.xls;Extended Properties="EXCEL 12.0;HDR=NO;IMEX=1";
I hava IMEX=1,but i can''t hava real data to database
How Can i get real data to database?
the excel files was Excel2007 sava as Excel97-2003

推荐答案

Hiya,

你可以试试看.
没有JET或OLE的Excel到SQL [没有JET或OLE的Excel to SQL(版本2) [
Hiya,

You could try this.
Excel to SQL without JET or OLE[^]

I have recently created a better version so that it can (amongst other things) incorporate xlsx files.

its here
Excel to SQL without JET or OLE (Version 2)[^]


这篇关于将Excel文件获取到Sql2008的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆