begin
filename:=extractfilepath(Application.ExeName);
filename:=Filename+'DB\Irontower.mdb';
with ADOConnection1 do
begin
ConnectionString :='Provider=Microsoft.Jet.OLEDB.4.0;'+
'DataSource='+filename+
';Persist Security Info=False' ; Connected := True;//Open DataBase
end;
AdoConnection1.Open;
AdoConnection1.Execute('delete from 中间表 ');
AdoConnection1.Close;
test:=renamefile(filename2,filename1) ;
Form2.AdoTable1.Active:=false;
for i:=0 to Count-1 do
begin
filename1:=Strings[i];
filename2:=changefileext(filename1,'.dbf');
renamefile(filename1,filename2) ;
path:=ExtractFilePath(filename1);
filename:=ExtractfileName(filename2);
AdoConnection1.Open;
AdoConnection1.Execute('Insert into 中间表 Select * from [dbase III;database='+path+'].'+filename+';');
AdoConnection1.Close;
test:=renamefile(filename2,filename1) ;
end ;
end
这段代码在delphi下运行没问题,不论是98还是XP
可是在每装delphi的98下运行报错,说什么 找不到某某dbf对象,请确定文件路径云云,可是dao2.7,msjet4.0等驱动都装了亚,各位大虾帮帮忙呀
filename:=extractfilepath(Application.ExeName);
filename:=Filename+'DB\Irontower.mdb';
with ADOConnection1 do
begin
ConnectionString :='Provider=Microsoft.Jet.OLEDB.4.0;'+
'DataSource='+filename+
';Persist Security Info=False' ; Connected := True;//Open DataBase
end;
AdoConnection1.Open;
AdoConnection1.Execute('delete from 中间表 ');
AdoConnection1.Close;
test:=renamefile(filename2,filename1) ;
Form2.AdoTable1.Active:=false;
for i:=0 to Count-1 do
begin
filename1:=Strings[i];
filename2:=changefileext(filename1,'.dbf');
renamefile(filename1,filename2) ;
path:=ExtractFilePath(filename1);
filename:=ExtractfileName(filename2);
AdoConnection1.Open;
AdoConnection1.Execute('Insert into 中间表 Select * from [dbase III;database='+path+'].'+filename+';');
AdoConnection1.Close;
test:=renamefile(filename2,filename1) ;
end ;
end
这段代码在delphi下运行没问题,不论是98还是XP
可是在每装delphi的98下运行报错,说什么 找不到某某dbf对象,请确定文件路径云云,可是dao2.7,msjet4.0等驱动都装了亚,各位大虾帮帮忙呀
解决方案 »
- 关于对adoconnection控件的connectionstring属性动态赋值的问题。
- 请问哪里有DELPHI7的串口通讯控件???????
- 求根据数据库动态生成菜单的代码
- 一个三层的程序,db:oralce, 客户端clientdataset在进行filter汉字时,总是报错EDBClient with message"type mismatch in expression"
- 各位帮帮忙啦!
- 怎么得怎么办才能改更系统颜色(如将真彩16色更改为真彩32色或256色等)
- 怎样控制DllMain?在哪里可以编辑这个函数?
- 为什么执行langid:=LeftStr(langid,3);竟然说undeclared identifier:'leftstr'
- 关于word2000风格的工具栏设计问题
- 对一个DELPHI初学者,哪几本书是必看的?帮忙介绍一下哦:)
- 从adoquery的查询结果集中再次查询,100分相送!
- 怎样截获数据包?
---------------------------------------------------------------------
AdoConnection1.Execute('Insert into 中间表 Select * from [dbase 5.0;database='+path+'].'+filename+';');
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\rsc;Extended Properties=dbase 5.0;Persist Security Info=False
学习ing …………
只是我有问题:ADO的连接字串中两个属性的值
一是:EXTENDED PROPERTIES,我所知连FOXPRO的DBF可用DBASE IV
连EXCEL可用EXCEL 8.0,,其它的呢,有这样一份完整的表吗?
二是:JET OLEDB:ENGINE TYPE,连FOXPRO的DBF可用17,
其它的呢,有这样一份完整的表吗?
我想很多人都想知道这个答案吧!!