我把EXCEL导入到ACESS中时,会自动打开office2000,还有瑞星的查毒.烦..

bells2000 bells2000 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
还有发觉好慢,,如果我在后台运行,office2000没有显示出来,瑞星还是有的,速度同样慢.
请问有没有什么办法不用打开这些啊,,我代码如下;

procedure TForm1.EX1Click(Sender: TObject);
var filename:string;

begin
fileName:='';
opendialog1.FileName:='';
opendialog1.Execute;
if opendialog1.FileName='' then Exit;
filename:=opendialog1.FileName;

Excelapp.Workbooks.Open (filename,
EmptyParam,EmptyParam,EmptyParam,EmptyParam,
EmptyParam,EmptyParam,EmptyParam,EmptyParam,
EmptyParam,EmptyParam,EmptyParam,EmptyParam,1);


adoConnection1.Execute('delete from table1');
adoConnection1.Execute('INSERT INTO table1(姓名,考勤号码,日期, 对应时段,上班时间,下班时间,签到时间,签退时间)' + 'SELECT 姓名,考勤号码,日期,对应时段, 上班时间,下班时间,签到时间,签退时间' +
' FROM [excel 8.0;database=' + fileName + '].['+GetName(FileName)+'$]');


Excelapp.Workbooks.Close(1);
ExcelApp.Quit;
with adoQuery1 do
begin
close();
sql.clear;
sql.Text:='select 姓名,考勤号码, 对应时段,上班时间,下班时间,签到时间,签退时间,每天工作时间 from table1';
open;
end;

end;
...全文

相关推荐

评论 13
收藏 已收藏
分享
返回顶部
bells2000
数据库相关 2,508 成员 88,437 内容