.dbf 文件转入oracle问题,快抓狂了,在线等。

gfmonsoon 2004-07-14 11:16:12
把本机上的 .dbf 文件转入 oracle中。
adoconnect1 已经连接了oracle

object ADOConnection1: TADOConnection
ConnectionString =
'Provider=MSDAORA.1;Password=xxx;User ID=xxx;Data Source=crm2' +
'46;Persist Security Info=True'
LoginPrompt = False
Provider = 'MSDAORA.1'

程序中:
//show为.dbf文件,temp1为oracle中的表,两个表同构
procedure TForm1.Button1Click(Sender: TObject);
begin
s:= 'insert into temp1 select * from show in ''c:\castpro\hq\'' ''dbase 5.0;'' ' ;
//或者写成下面这样
//s:='insert into temp1 select * from OpenDataSource( ''Microsoft.Jet.OLEDB.4.0'',''Data Source="c:\castpro\hq\";User ID=;Password=;Extended properties=dBase 5.0'')...show';
with adoconnection1 do
begin
connected := true;
showmessage(s);
execute(s);
showmessage(s);
end;
end;


但这两条语句执行的时候都提示sql命令未正确结束,快抓狂了。

...全文
92 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
Merrybip 2004-07-14
  • 打赏
  • 举报
回复
不是去分号‘;’

我以前做过

s:= 'insert into temp1 select * from show in "c:\castpro\hq\" "dbase 5.0;" ' ;

我就是这样写的
gfmonsoon 2004-07-14
  • 打赏
  • 举报
回复
我就是看大富翁上的帖子才想这么做的,呵呵。
现在就试试楼上两位的方法。
cronuz 2004-07-14
  • 打赏
  • 举报
回复
s:= 'insert into temp1 select * from show in ''c:\castpro\hq\'' ''dbase 5.0'' ';

(注:去除最後的分号';'試試)
Merrybip 2004-07-14
  • 打赏
  • 举报
回复
s:= 'insert into temp1 select * from show in ''c:\castpro\hq\'' ''dbase 5.0;'' ' ;
是错的
不是2个单引号
而是1个双引号
所以是:
s:= 'insert into temp1 select * from show in "c:\castpro\hq\" "dbase 5.0;" ' ;

你在试试!!!


Merrybip 2004-07-14
  • 打赏
  • 举报
回复
http://www.delphibbs.com/delphibbs/dispq.asp?lid=1691966

你看看去
befree 2004-07-14
  • 打赏
  • 举报
回复
用VFP7或VFP8中的fox的olddb(ado)驱动
gfmonsoon 2004-07-14
  • 打赏
  • 举报
回复
晕菜啊,哪位大侠出手相救,help
gfmonsoon 2004-07-14
  • 打赏
  • 举报
回复
按着 Merrybip(陈)的方法试了,还是提示sql命令未正确结束。
my god,??????????????????????

5,379

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧