//这是从ORACLE 转到 ACCESS
if not ad.Connected then
ad.Connected := true;
ad.Execute('select * into STORY_IMPORTANCE from STORY_TYPE in [ODBC][ODBC;Driver=Oracle in OraHome92;UID=cc;PSW=cc;Server=192.168.2.190;DataBase=orcl190]');
这是从ACCESS 转到 ORACLE
if not ad2.Connected then
ad2.Connected := true;
ad.Execute('select * into STORY_IMPORTANCE from opendatasource(' quotedstr('microsoft.jet.oledb.4.0') ',' quotedstr('data sourc=D:\code\AppPortal\newAPP\SYS_ADMIN\app\local.mdb') ')...[STORY_IMPORTANCE]');
先将ORACLE查询生成一临时表(TAB1),再导入ACCESS中。
将Oracle导入到Access
ADOCONNECTION连接串:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\temp\db1.mdb;Persist Security Info=False
SQL语句
SELECT * into tablename FROM Tab1 IN [ODBC]
[ODBC;Driver={Microsoft ODBC for Oracle};UID=oracle;PWD=oracle;SERVER=yourdata;]
1)直接将oracle中记录检索出,用ado方式一条一条插入access; 2)将oracle的记录导出到文本文件,再用docmd的transfertext方法导入access;3)直接将oracle中记录检索出,并用DoCmd中RunSql方式一条一条插入access。发觉速度最快的是第2)种方式,其次是3),最慢的是1)。其中2)和3)都用了ole.