我想把一个excel文件中的数据导入到sql server2000中的某张表stu_info中,当然表stu_info已经建好了,我用procedure TFrmStuMgr.bbtnExcelToDBClick(Sender: TObject);
begin
with dsInport do
begin
CommandText:='';
CommandText:='insert * into stu_info (select * from opendataset('Microsoft.Jet.OLEDB.4.0','Data Source=".\20000506.xls"; Extended Properties="Excel 8.0;
HDR=Yes;";Persist Security Info=False')...200005$)
open
end;
end;
这些语句是我在论坛上找到了,但要出错,我不知道怎么办。如何还能实现,编译要出错,我不知道怎么办,请教!
谢谢!!! 如有哪位大侠已经做好的,请给我演示一下好吗?邮箱:[email protected]
begin
with dsInport do
begin
CommandText:='';
CommandText:='insert * into stu_info (select * from opendataset('Microsoft.Jet.OLEDB.4.0','Data Source=".\20000506.xls"; Extended Properties="Excel 8.0;
HDR=Yes;";Persist Security Info=False')...200005$)
open
end;
end;
这些语句是我在论坛上找到了,但要出错,我不知道怎么办。如何还能实现,编译要出错,我不知道怎么办,请教!
谢谢!!! 如有哪位大侠已经做好的,请给我演示一下好吗?邮箱:[email protected]
adoquery1.SQL.Add('select * into TABLE from [SHEET1$] in "d:\TEMP\123.xls" "excel 8.0;"');