從excel導入到數據庫的問題(50分)

  • 主题发起人 主题发起人 ray_shan
  • 开始时间 开始时间
R

ray_shan

Unregistered / Unconfirmed
GUEST, unregistred user!
我想問一下excel導入到數據庫的問題,以甚麼方式實現比較好. &nbsp; 最好有元碼.<br>是先從excel導入到stringgird 或 dbgird中,在導入數據庫中.
 
给你一段代码供你参考。<br>使用数据库的方式打开,然后处理就是。相当于数据库表到表的操作。<br>var no,i,j:integer;<br> &nbsp;tt:TStrings;<br> &nbsp;SheetName:string; //<br>begin<br> &nbsp;with datam.DataM1 do //首先查找数据库中是否已经存在。如果存在,则修改已经存在的数据。<br> &nbsp;begin<br> &nbsp; &nbsp;ExcelConnection.Close;<br> &nbsp; &nbsp;ExcelConnection.ConnectionString:='Provider=MSDASQL.1;Persist Security Info=False;Extended Properties=&quot;DSN=Excel Files;'+<br> &nbsp; &nbsp; &nbsp;'DBQ='+FileName+';DriverId=790;MaxBufferSize=2048;PageTimeout=5;&quot;';<br> &nbsp; &nbsp;ExcelConnection.Open;<br> &nbsp; &nbsp;tt:=tstringlist.Create;<br> &nbsp; &nbsp;ExcelConnection.GetTableNames(tt,true);<br> &nbsp; &nbsp;SheetName:=tt.Strings[0];<br> &nbsp; &nbsp;ExcelQuery1.Close;<br> &nbsp; &nbsp;ExcelQuery1.SQL.Clear;<br> &nbsp; &nbsp;ExcelQuery1.SQL.Add('select * from ['+SheetName+'] '); //全部数据<br> &nbsp; &nbsp;ExcelQuery1.Open; //打开EXCEL文件.<br> &nbsp; &nbsp;if ExcelQuery1.IsEmpty then Exit; //excel中无数据,无法载入.<br>。。。。下面是数据载入处理。
 
to: zywcd &nbsp;<br> &nbsp; &nbsp;我想問一下這種方式往,oracle中導入也可以麼?
 
这样的方式应该可以写入任何数据库吧。excel已经想数据库一样打开了,你怎么做是你自己写代码完成。操作方式和对数据库一样的。
 
问题: 异构数据库之间完全可以用SQL语句导数据。大家抛弃BatchMove吧 如果觉得好请Up一下,如果觉得不好也请Up一下 ( 积分: 1 ) &nbsp;<br>分类: 数据库-C/S型 &nbsp;<br> <br>来自: 碧血剑, 时间: 2003-03-18 16:33:00, ID: 1691966 &nbsp;<br>告诉你一个最快的方法,用SQLServer连接DBF <br>在SQLServer中执行 <br>SELECT * into bmk <br>FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', <br> 'Data Source=&quot;e:/share&quot;;User ID=Admin;Password=;Extended properties=dBase 5.0')...bmk <br>这样就可以把e:/share中的bmk.dbf表导入到Sqlserver中, <br>速度是最快的 <br>把压箱底的方法都告诉大家 <br>在Form上放一个ADOConnection,连结指向目标Access库 <br>比如txt文件在c:/temp/aaaa.txt <br>就执行 <br>ADOConnection.Connected := True; <br>ADOConnection.Execute('Select * Into abcd From [Text;Database=c:/temp].aaaa.txt'); <br>就一切Ok了,这个方法一定行的,我好不容易才研究出来的 <br>有了这两个例子,异构数据库之间导数据的问题就举一反三,迎刃而解了。 <br><br>把Excel导入到Access中,同txt类似 <br>select * into &lt;table name&gt; from [excel 8.0;database=&lt;filename&gt;].[&lt;sheetname&gt;$] <br><br>我最讨厌别人用BatchMove导数据了,明明一个SQL的事情,偏要。。。 <br>我的目标是让大家抛弃BatchMove <br> <br>来自: bbs-wqt, 时间: 2003-03-18 16:45:00, ID: 1692009 &nbsp;<br>谢谢!!!! <br> <br>来自: chshanghai, 时间: 2003-03-18 17:34:00, ID: 1692195 &nbsp;<br>不错,不错,刚试过, 很好,很好很好很好很好很好 <br><br><br><br> <br>来自: rogue_xu, 时间: 2003-03-18 19:52:00, ID: 1692532 &nbsp;<br>從哪裡學到的,敬仰中! <br> <br>来自: chshanghai, 时间: 2003-03-19 17:42:00, ID: 1695286 &nbsp;<br>不错,是不错, 不过对foxpro 6.0中有些字段是打不开的. &nbsp;像foxpro 中datetime 类型的字段. <br> <br>来自: bbs-wqt, 时间: 2003-03-19 17:45:00, ID: 1695291 &nbsp;<br>佩服!好!不错!很棒! <br>帅呆了![h4][green]酷逼乐!![/green][/h4][:D][:(!] <br> <br>来自: 碧血剑, 时间: 2003-03-19 17:53:00, ID: 1695299 &nbsp;<br>to: chshanghai <br>对于VFP6.0,那就要换Extended properties属性了 <br>理论上只要是ODBC能实现连结的数据库的,都可以的 <br>当然不是所有的数据库了:) <br> <br>来自: txm, 时间: 2003-03-19 18:19:00, ID: 1695396 &nbsp;<br>好!早几天看到就好多了[:D] <br>不过现在也不迟的[^] <br>谢谢!!! <br> <br>来自: dhl2001, 时间: 2003-03-19 18:22:00, ID: 1695403 &nbsp;<br>第二个方法很棒, <br><br> <br>来自: litong, 时间: 2003-03-19 18:22:00, ID: 1695404 &nbsp;<br>good <br> <br>来自: 风姿, 时间: 2003-03-19 18:30:00, ID: 1695420 &nbsp;<br>hao .佩服。 <br> <br>来自: coolfun, 时间: 2003-03-19 18:45:00, ID: 1695443 &nbsp;<br>真的很佩服你啊。前几天还寻找这样的方法都没找到。昨天只能自己用循环搞定了,不过 <br>也不晚啊,马上换代码,哈哈。 <br> <br>来自: coolfun, 时间: 2003-03-19 18:48:00, ID: 1695448 &nbsp;<br>不过还想问一下,怎么用SQL语句把ACCESS表导出TXT文件中? <br> <br>来自: sky0061, 时间: 2003-03-19 21:43:00, ID: 1695757 &nbsp;<br>试试先,如果可能就太棒了。 <br>不管怎么样,谢谢楼主先,这是个好经验。 <br> <br>来自: 斗士, 时间: 2003-03-20 0:45:00, ID: 1695961 &nbsp;<br>速度还可以,28858行数据花费46秒; <br>不过这行SQL是否可以在程序中运行,SQL.Add(),ExecSQL; <br>另如何把SQL Server的表导出到Access、Text、Dbf。 <br> <br>来自: 碧血剑, 时间: 2003-03-20 8:08:00, ID: 1696027 &nbsp;<br>to :coolfun <br>ADOConnection.Execute('Select * Into [Text;Database=c:/temp].aaaa.txt From aaaa'); <br>to: :斗士 <br>当然可以在程序中运行 <br>SQL Server表导出和txt导入一个道理 <br>基本上都是用Jet4.0 和 ODBC连结实现 <br>先用用Jet4.0连结dbf,access,txt然后利用SQL语句导出导入 <br>在此我就不详细说了,一句话,都可以的 <br>列出连结串属性Extended properties, <br>DBase 5.0 <br>DBASE IV <br>FoxPro 3.0 <br>Paradox 7.X <br>Excel 8.0 <br>text;HDR=YES;FMT=Delimited <br><br> <br>来自: chshanghai, 时间: 2003-03-20 8:49:00, ID: 1696146 &nbsp;<br>to 楼主; <br> &nbsp;我以前用过openquery 这个过程. 感觉与openquery 差不多. <br> &nbsp; 想问一下 &nbsp;opendatasource 与 &nbsp;openquery 有什么区别? &nbsp;谢谢. <br><br> &nbsp;还有 opendatasource 是哪里的. 好像我在帮助里没有找到. <br> &nbsp;<br> <br>来自: 碧血剑, 时间: 2003-03-20 8:54:00, ID: 1696169 &nbsp;<br>to <br>openquery 需要先建立链接服务器 <br>openrowset和opendatasource不用,在SQLServer联机帮助都可以查到 <br> <br>来自: ninsen, 时间: 2003-03-20 10:14:00, ID: 1696505 &nbsp;<br>TO 碧血剑 <br> &nbsp;仁兄果然是高手,不但技术好而且还乐意和别人分享知识,我最佩服这种人。请问仁兄 <br>有OICQ吗?可否让小弟加你为好友,遇到问题也可以请仁兄请教。 <br> &nbsp;可能小弟头脑比较笨,按照你的方法研究了很久也没能研究出怎么样把Excel工作表导 <br>出为mdb或sql数据库,请仁兄指教,不胜感激。 <br> <br>来自: 碧血剑, 时间: 2003-03-20 10:24:00, ID: 1696544 &nbsp;<br>我刚才试验成功的 <br>Excel联接ADO串 <br>Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:/temp/a.xls;Extended <br>Properties=&quot;Excel 8.0;HDR=Yes;&quot;;Persist Security Info=False <br><br>SQLServer从Excel取数 <br>SELECT * <br>FROM OpenDataSource('Microsoft.Jet.OLEDB.4.0','Data Source=&quot;C:/temp/b.xls&quot;;Extended Properties=&quot;Excel 5.0;HDR=Yes;&quot;;Persist Security Info=False')...sheet1$ <br><br>我的QQ号连我都不记得,不经常用 <br>Email: jl1999@163.net <br><br> <br>来自: coolfun, 时间: 2003-03-20 11:29:00, ID: 1696833 &nbsp;<br>TO 碧血剑: <br>高手就是高手,哈哈。而且你愿意把技术与大家分享,可敬。 <br><br>可敬的高手!!!!!! <br> <br>来自: 斗士, 时间: 2003-03-20 11:36:00, ID: 1696857 &nbsp;<br>从SQL Server导出时,用以下语句: <br>ADOConnection.Execute('Select * Into [Text;Database=c:/temp].aaaa.txt From aaaa'); <br>报错:[c:/temp].aaaa.txt 数据库不存在; <br>连接SQL Server的ADOConnection使用Microsoft OLE DB Provider for SQL Server; <br>改用Access导出Text,ADOConnection用Jet 4.0,可以成功。什么原因? <br><br> <br>来自: 原野飞侠, 时间: 2003-03-20 11:36:00, ID: 1696858 &nbsp;<br>好 <br> <br>来自: 碧血剑, 时间: 2003-03-20 11:54:00, ID: 1696914 &nbsp;<br>:斗士 <br>那就是Access导出到文本的 <br>有两种方法 <br>1。SQLServer先建立链接服务器,然后导出, <br>2。ADO连接指向Txt,导出 <br><br> <br>来自: 斗士, 时间: 2003-03-20 12:01:00, ID: 1696941 &nbsp;<br>:大侠碧血剑 <br>1、SQL Server 导出Access、Dbf、Excel、Text等; <br>2、Access导出Excel、Dbf、SQL Server; <br>能否详细一点叙述,有代码最好,谢谢! <br> <br>来自: xuefeiyang, 时间: 2003-03-20 12:13:00, ID: 1696968 &nbsp;<br>up <br> <br>来自: 唐佐平, 时间: 2003-03-20 12:51:00, ID: 1697077 &nbsp;<br>Txt文件导入Sql Server怎么写? <br> <br>来自: maplesw, 时间: 2003-03-20 12:57:00, ID: 1697106 &nbsp;<br>高手就是高手!能与大家一起分享精品劳动成果! <br> <br>来自: zhang_yz6666, 时间: 2003-03-20 13:50:00, ID: 1697330 &nbsp;<br>高手就是高手!能与大家一起分享精品劳动成果! <br>向你致敬! <br><br> <br>来自: qrenj, 时间: 2003-03-20 14:22:00, ID: 1697443 &nbsp;<br>…… <br>楼主,要是ACCESS数据导到INFORMIX或者是ORACLE里面则么做啊 还不是BATCHMOVE? <br> <br>来自: 碧血剑, 时间: 2003-03-20 14:31:00, ID: 1697475 &nbsp;<br>txt导入SQLServer <br>select * from OpenRowset('MSDASQL', 'Driver={Microsoft Text Driver (*.txt; *.csv)}; <br>DefaultDir=c:/temp;','select * from aaaa.txt') <br><br>to qrenj <br>Access导入ORACLE肯定可以 <br>INFORMIX我没用过 <br>我说过了,只要是微软支持的OLE DB和ODBC连接的 <br>一定可以 <br> <br>来自: ufo!, 时间: 2003-03-20 19:50:00, ID: 1698513 &nbsp;<br>谢谢楼主。 <br> <br>来自: www.www, 时间: 2003-03-21 10:18:00, ID: 1699555 &nbsp;<br>good <br> <br>来自: dirk, 时间: 2003-03-21 10:41:00, ID: 1699670 &nbsp;<br>这种方法我四年前就发现了,不过那时还没用delphi,在Access中使用的,最近有个人问了 <br>类似的问题,我回答了,好像也没什么人关注嘛![:(] <br> <br>来自: dreamfly1024, 时间: 2003-03-21 10:53:00, ID: 1699729 &nbsp;<br>[:)] <br> <br>来自: 唐佐平, 时间: 2003-03-21 11:23:00, ID: 1699883 &nbsp;<br>txt文件中每个字段的分割符是什么? <br> <br>来自: 碧血剑, 时间: 2003-03-21 11:46:00, ID: 1699985 &nbsp;<br>to:唐佐平 <br>默认逗号或空格,可以在连接串中指定 <br> <br>来自: pldu, 时间: 2003-03-21 15:30:00, ID: 1700903 &nbsp;<br>第二种方法从sql server导出到access如何写 <br> <br>来自: 碧血剑, 时间: 2003-03-22 9:24:00, ID: 1702318 &nbsp;<br>我都说了要举一反三的,可是还是有人问类似的问题,算了,再贴两个例子 <br>c:/temp/aaa.dbf to Access, <br>ADOConnection 指向Access <br>语句是 &nbsp;select * into bbb from aaa in 'c:/temp' 'dbase 5.0;' <br><br>sql server导出到access <br>ADOConnection 指向Access <br>SELECT * into table &nbsp;FROM Tab1 IN [ODBC] <br>[ODBC;Driver=SQL Server;UID=sa;PWD=;Server=127.0.0.1;DataBase=Demo;] <br><br> <br>来自: jianlei, 时间: 2003-03-22 10:56:00, ID: 1702482 &nbsp;<br>是否只有ADOConnection连接目的地支持SELECT &nbsp;INTO语句才能行,好象在Interbase中不行,请“碧血剑”兄明示! <br> <br>来自: 碧血剑, 时间: 2003-03-22 15:01:00, ID: 1702882 &nbsp;<br>Interbase我没用过:) select into 不行还有insert into呀 <br>好像她只支持BDE吧 <br>如果不支持ODBC,应该就不行 <br> <br>来自: ninsen, 时间: 2003-03-22 15:10:00, ID: 1702894 &nbsp;<br>to 碧血剑 <br> &nbsp;谢谢仁兄帮我解决了那么多的问题,非常感谢。小弟在这方面还是个初学者,希望能和 <br>仁兄做个朋友,不知仁兄意下如何。 <br> &nbsp;MDB和DBF转换为EXCEL,EXCEL转换为MDB或者DBF,设置主键小弟在仁兄的帮助下已经解 <br>决,但还有一问题不能解决,那就是EXCEL,MDB转换为SQL无法解决。请仁兄指点一下,不 <br>胜感激。因那边我提问题想结贴,所以在这里提问。 <br> <br>来自: 碧血剑, 时间: 2003-03-22 15:46:00, ID: 1702976 &nbsp;<br>to ninsen <br>看一下SQLServer联机帮助的 <br>OpenDataSource和OpenRowSet函数 <br>有具体的例子 <br> <br>来自: jump8, 时间: 2003-03-22 15:58:00, ID: 1703003 &nbsp;<br>楼主你好!我在我提出的同一个问题中已给你加分了。 <br>但在VFP6.0转换时还是会出现 chshanghai 所说的datetime 类型的字段不能转换。 <br>我试过DBase 5.0、DBASE IV、FoxPro 3.0等等Extended properties属性都不行, <br>请问在还有哪些Extended properties属性可以使用?谢谢! <br><br> <br>来自: 碧血剑, 时间: 2003-03-22 16:12:00, ID: 1703043 &nbsp;<br>我也要到MSDN上才能查到,可是从今天起我可能会比较忙 <br>现在要下线了,我可是用小猫猫上网的呀 <br>你先用VFP的create table 还是 select into 具体我忘了:) <br>把格式转为dabse的,再导数据 <br>试试 <br><br> <br>来自: ninsen, 时间: 2003-03-22 16:16:00, ID: 1703047 &nbsp;<br>to 碧血剑 <br> &nbsp; 小弟比较笨,看了帮助以后还是不能解决问题,请仁兄给出具体操作步骤发给我的 <br>信箱吧,chenninsen@163.net,麻烦了。EXCEL或者MDB和SQL互换,在DELPHI中写程序。 <br> <br>来自: l_q28, 时间: 2003-03-22 16:25:00, ID: 1703073 &nbsp;<br>UP <br> <br>来自: jump8, 时间: 2003-03-22 16:39:00, ID: 1703103 &nbsp;<br>to 碧血剑 <br> &nbsp;我试过了,把格式转为dabse的再导数据是可以的。但我要在VFP生成的数据中取出数据 <br>上传到MS-SQL2000,所以还是要用VFP6.0的格式,MSDN能找到吗,我好象没有看到的?麻烦 <br>你有空的时候帮我找找看,谢谢! <br><br> <br>来自: fyyx2002, 时间: 2003-03-22 17:18:00, ID: 1703190 &nbsp;<br>===============》 <br>真希望每个人都能象楼主那样把自己摸索的经验和过程拿出来和大家分享探讨,中国的软件 <br>事业就一定会繁荣起来!这样才是真正的中国精神,不要在做敝帚自珍的事了!团结起来 <br>为了你我共同的进步,为了中国软件事业的腾飞!让我们能以自己是中国人而自豪! <br>=====================》 <br> <br>来自: xa_t, 时间: 2003-03-23 14:27:00, ID: 1704141 &nbsp;<br>请问如果要update/insert,你如何解决呢???[?][?][?] <br> <br>来自: 碧血剑, 时间: 2003-03-23 18:17:00, ID: 1704486 &nbsp;<br>to :xa_t 我晕了 <br>把select 语句改成insert into或update语句呀 <br> <br>来自: lovedp, 时间: 2003-03-23 19:34:00, ID: 1704578 &nbsp;<br>up <br> <br>来自: kongl, 时间: 2003-03-24 13:22:00, ID: 1706007 &nbsp;<br>连接excel不好用啊,用帮助中的例子也不成功. <br><br> <br>来自: coolfun, 时间: 2003-03-25 14:35:00, ID: 1708966 &nbsp;<br>to 碧血剑 <br> 再请教一个问题,我这里要求要ACCESS的数据表导出到TXT文件中,要求以TAB来分隔每 <br>个字段,请问怎么实现。 <br> <br>来自: 碧血剑, 时间: 2003-03-26 8:27:00, ID: 1710470 &nbsp;<br>应该是这样吧 <br>SELECT * INTO [Text;DATABASE=文本文件路径;TabDelimited].[文本文件名称] FROM Table <br> <br>来自: gamegirl, 时间: 2003-03-26 8:31:00, ID: 1710480 &nbsp;<br>谢谢 <br> <br>来自: lwz18, 时间: 2003-03-26 15:54:00, ID: 1712378 &nbsp;<br>[?]请问visual foxpro 6.0 怎么导到sql server 2000去? <br>我执行SELECT * into rqjj <br>FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', <br> 'Data Source=e:/rqjj;User ID=sa;Password=linkcm;Extended properties=visual foxpro 6.0')...rqjj <br>select * from rqjj <br>提示如下:服务器: 消息 7399,级别 16,状态 1,行 1 <br>OLE DB 提供程序 'Microsoft.Jet.OLEDB.4.0' 报错。验证失败。 <br>[OLE/DB provider returned message: 无法启动应用程序。工作组信息文件丢失,或是已被其它用户以独占方式打开。] <br>OLE DB 错误跟踪[OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0' IDBInitialize::Initialize returned 0x80040e4d: &nbsp;验证失败。]。 <br><br> <br>来自: coolfun, 时间: 2003-03-26 18:37:00, ID: 1712914 &nbsp;<br>TO:碧血剑 <br><br>来自:碧血剑, 时间:2003-3-23 18:17:00, ID:1704486 <br>to :xa_t 我晕了 <br>把select 语句改成insert into或update语句呀 <br><br>用select 语句是可以的,但是用insert into的时候,就说insert into语法错误,请你 <br>帮忙。随便再问一下,access的表怎么样导出来dbase5.0中。 <br><br><br> <br>来自: wr960204, 时间: 2003-03-28 16:18:00, ID: 1718748 &nbsp;<br>挺好的 <br> <br>来自: zhaq, 时间: 2003-03-30 1:11:00, ID: 1721697 &nbsp;<br>老兄,我想把分割符为‘|’的文本文件导入到sqlserver中,怎么写语句?并且文本文件在客户机上 <br>,我是不是还要把文本文件拷到sqlserver服务器上才能导入?倒入前是不是要到odbc里配置 <br>文本文件,会否则提示你列名与表定义不符?谢谢碧血剑给够解释。 <br> <br>来自: jinyfboss, 时间: 2003-03-30 0:12:00, ID: 1721716 &nbsp;<br>碧血剑: <br>佩服!佩服!敬仰!敬仰!难得!难得[:)] <br> <br>来自: myjane, 时间: 2003-03-31 11:45:00, ID: 1724094 &nbsp;<br>TO:碧血剑 <br>VTP 6.0 如何导到ACCESS中???? <br> <br>来自: 任豆豆, 时间: 2003-03-31 11:49:00, ID: 1724109 &nbsp;<br>good <br> <br>来自: lovedp, 时间: 2003-03-31 11:59:00, ID: 1724144 &nbsp;<br>UP!俺也试试! <br> <br>来自: kypansky, 时间: 2003-03-31 17:26:00, ID: 1725537 &nbsp;<br>SQL Server数据导到Excel数据库怎么做呀?能说详细点吗? <br> <br>来自: 碧血剑, 时间: 2003-03-31 19:19:00, ID: 1725855 &nbsp;<br>to :kypansky <br>sql server导出到excel和sql server导出到Access是一样的 <br>ADOConnection 指向excel, 用Jet4.0 ,Extended properties设为Excel 8.0 <br>SELECT * into table &nbsp;FROM Tab1 IN [ODBC] <br>[ODBC;Driver=SQL Server;UID=sa;PWD=;Server=127.0.0.1;DataBase=Demo;] <br><br><br> <br>来自: kypansky, 时间: 2003-03-31 22:56:00, ID: 1726289 &nbsp;<br>十分感谢碧血剑的回答.我使用时,不知道哪地方没有设好?出现死等的状态.你帮我看一下下面设置对吗? <br>在Form中设置ADOConnection1的联接属性如下(test.xls:为我要将数据导入文件名.): <br>Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:/TEMP/test.xls;Extended Properties=Excel 8.0 <br>程序如下: <br>procedure TFormMain.Button1Click(Sender: TObject); <br>begin <br>ADOConnection1.Connected ; <br>ADOConnection1.Execute ('SELECT * into &nbsp;test01 FROM Fund IN [ODBC] [ODBC;Driver=SQL Server;UID=admin;PWD=;Server=(lacal);DataBase=CMBXMDM;]'); <br>end; <br>但执行时,是死等(死机)状态.查看进程:未响应 <br>谢谢! <br><br><br> <br>来自: nokia33503350, 时间: 2003-05-27 10:44:00, ID: 1726748 &nbsp;<br>说说vfp6.0的自由表如何快速导入到access2000中。 <br> <br>来自: 碧血剑, 时间: 2003-04-01 16:55:00, ID: 1728422 &nbsp;<br>:kypansky, <br>我自己试了一下,没问题的 <br>我的连接串 <br>Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=C:/temp/a.xls;Mode=Share Deny None;Extended Properties=&quot;Excel 8.0;HDR=Yes;&quot;;Persist Security Info=False;Jet OLEDB:System database=&quot;&quot;;Jet OLEDB:Registry Path=&quot;&quot;;Jet OLEDB:Database Password=&quot;&quot;;Jet OLEDB:Engine Type=34;Jet OLEDB:Database Locking Mode=0;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password=&quot;&quot;;Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False <br>语句 <br>ADOConnection1.Execute ('SELECT * into &nbsp;test01 FROM vda1 IN [ODBC] [ODBC;Driver=SQL Server;UID=sa;PWD=;Server=jl;DataBase=ynxf;]'); <br><br>估计可能是你的SQLServer的问题 <br><br> <br>来自: unidragon, 时间: 2003-04-05 17:03:00, ID: 1741095 &nbsp;<br>up!!! <br> <br>来自: Radeon, 时间: 2003-04-08 23:57:00, ID: 1750666 &nbsp;<br>to 碧血剑: <br> 谢谢!我摸了一个月,也没有搞定这些事。现在得到了你的指点,真是太感谢了。 <br> 碧血剑,delphibbs good。 <br> <br>来自: jsjjohn, 时间: 2003-04-09 8:50:00, ID: 1750935 &nbsp;<br>佩服,好方法。交个朋友:kuangke@sina.com <br> <br>来自: qinwq, 时间: 2003-04-09 9:03:00, ID: 1750977 &nbsp;<br>真是高手,帮我解决大问题了。谢谢你。 <br> <br>来自: qinwq, 时间: 2003-04-09 9:37:00, ID: 1751129 &nbsp;<br>to 碧血剑: <br> &nbsp;能否告诉我access转dbf,excel的办法? <br> &nbsp;谢谢! <br> <br>来自: hmzz, 时间: 2003-04-09 11:35:00, ID: 1751667 &nbsp;<br>为什么我的是这样: <br>SELECT * <br>FROM OpenDataSource('Microsoft.Jet.OLEDB.4.0','Data Source=&quot;d:/Book1.xls&quot;;Extended Properties=&quot;Excel 5.0;HDR=Yes;&quot;;Persist Security Info=False')...sheet1$ <br>------------------------------------------------- <br><br>服务器: 消息 7399,级别 16,状态 1,行 1 <br>OLE DB 提供程序 'Microsoft.Jet.OLEDB.4.0' 报错。提供程序未给出有关错误的任何信息。 <br><br> <br>来自: hmzz, 时间: 2003-04-09 11:37:00, ID: 1751676 &nbsp;<br>哦,应该是8.0才对 <br> <br>来自: DELPHI鸟, 时间: 2003-04-10 0:53:00, ID: 1754171 &nbsp;<br>我是个菜鸟,提个问题大家别笑。假设我的理解没有错误的话。 <br>我理解:楼主的思路是可以将源数据库中的数据倒成文本文件,再将文本文件传到SQL-Server <br>中。将规范的文本文件(字段数据间有,等分隔)写入到SQL-SERVER、MY-SQL、ACCRESS中 <br>是完全没有问题的。但是我有个问题在ACCRESS中OLE对象如果存成文本文件,将是以什么方式 <br>写的。在ACCRESS中的OLE对象是在字段前进行加位处理的。如果按照加位以后的文本文件向 <br>SQL-Server中写如的话,是否能保证目标数据库图象和源数据库中的图象是完全一样的。 <br>还有关于时间字段的处理。楼上的各位大侠是怎么处理的? <br>小弟实在是很笨希望大家不吝赐教! <br> <br>来自: DELPHI鸟, 时间: 2003-04-10 0:54:00, ID: 1754173 &nbsp;<br>不知道楼主能不能有耐心看到我以上的留言啊? <br><br> <br>来自: jslygwx, 时间: 2003-04-10 9:22:00, ID: 1754552 &nbsp;<br>UP <br> <br>来自: chunming, 时间: 2003-04-10 9:38:00, ID: 1754631 &nbsp;<br>晕,我用Access数据库成功,但用Oracle不可以导出数据到Text啊!!!!! <br><br> <br>来自: iwantflywithwinder, 时间: 2003-04-16 11:32:00, ID: 1773604 &nbsp;<br>hmzz,你的excel表正在打开,关闭就好了。 <br>我有个问题要和大家讨论啊,就是opendatasourse里面的参数我想用变量代替, <br>却无法实现,求解决的办法。因为实际应用中文件是要求课选择的啊。 <br>declare @ds varchar(200) <br>select @ds=char(39)+'Data Source=D:/srmisII/srmisii文档/实施/0415/编码.xls'+';User ID=Admin;Password=;Extended properties=Excel 5.0'+char(39) <br>print @ds <br>SELECT * FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',@ds)...goods$ <br><br>char(39)是' <br> <br>来自: 碧血剑, 时间: 2003-04-17 21:45:00, ID: 1779611 &nbsp;<br>to:DELPHI鸟 <br>你的问题直接将Access导入SQLServer就可以了,和用不用文本无关呀! <br>不明白你为什么要Access-&gt;txt-&gt;SQLServer,直接Access-&gt;SQLServer就可以了 <br><br>to:iwantflywithwinder <br>你把整个语句赋给一个变量,然后exec就可以了 <br><br> <br>来自: bihai, 时间: 2003-04-19 16:40:00, ID: 1783958 &nbsp;<br>以下用法我測試的情形存在以下問題,以簡体中OK,在繁体下出錯(導出為paradox表) <br>&quot;Database 'paradox 7.x;database=..'does not exist&quot; <br><br>ADOConnection.Execute('Select * Into abcd From [Text;Database=c:/temp].aaaa.txt'); <br><br> <br>来自: zhbforce, 时间: 2003-04-19 18:18:00, ID: 1784217 &nbsp;<br>cn.Execute('SELECT * into &nbsp;test01 FROM JSBB1 in [ODBC]'+ <br> &nbsp; &nbsp; &nbsp; '[ODBC;dsn=myora;User Name=scott;password=tiger]'); <br><br>将Oracle导入到Access的方法,速度非常之快,3000多条记录,只需要4秒钟。 <br>但是有一个缺点:每次运行到这里的时候,都会跳出Oracle8 ODBC Driver Connnect <br>的对话框,要求输入密码,不知道有没有办法将其屏蔽掉? <br><br>加入Persist Security Info=True也不行。 <br><br>多谢碧血剑兄,打心眼里佩服! <br> <br>来自: chunming, 时间: 2003-04-21 10:12:00, ID: 1786813 &nbsp;<br>碧血剑兄,有没有做过从Oracle导入到Text? <br>我试了两种方法: <br>1、ADOConnection1.Execute('select * into [text:Database=E:/TEST].TEST.txt from mara'); <br>结果是出错,信息为:“Invalid Character”。 <br>这个可以理解:Oracle不支持Select into。 <br><br>2、ADOConnection1.Execute('create table [text:Database=E:/TEST].TEST.txt as select * from mara'); <br>错误信息为:“Invalid Table Name” <br><br>请教从Oracle导入到Text或Text导入到Oracle的方法。多谢! <br> <br>来自: henrygaun, 时间: 2003-04-23 0:35:00, ID: 1793528 &nbsp;<br><br>请教从sql sever导出数据到*.db <br> <br>来自: 碧血剑, 时间: 2003-04-23 9:48:00, ID: 1794057 &nbsp;<br>to henrygaun <br>同SQLServer-&gt;excel类似,只是连结串属性pardox 7.X就行了 <br> <br>来自: chunming, 时间: 2003-04-23 9:51:00, ID: 1794066 &nbsp;<br>碧血剑兄没做过Oracle的导入导出吗?或者给些建议,多谢! <br> <br>来自: kypansky, 时间: 2003-04-23 12:55:00, ID: 1794880 &nbsp;<br>碧血剑: <br> 你好! <br> 在SQLServer中执行SELECT * into bmk FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0','Data Source=&quot;e:/share&quot;;User ID=Admin;Password=;Extended properties=dBase 5.0')...bmk <br> 这样就可以把e:/share中的bmk.dbf表导入到Sqlserver中. <br> 但在操作时发现SQL Server数据库如果不装在本机(DBF文件在本机),而是装在网络机器上执行时会有问题.而若DBF文件和SQL Server数据库在同一机器上时就没有问题.请问如何解决这个问题呢? <br> 谢谢! <br> <br>来自: 碧血剑, 时间: 2003-04-23 15:59:00, ID: 1795713 &nbsp;<br>to chunming <br>看你楼上的留言,方法类似 <br>to kypansky <br>SQLServer在服务端执行语句,所以DBF必须在服务器上, <br>你只能把它拷过去执行 <br> <br>来自: henrygaun, 时间: 2003-04-24 13:27:00, ID: 1798502 &nbsp;<br><br>多谢碧血剑的指教 <br> 请问txt-&gt;sqlsever时,如果用tab分开各个字段?能说详细点吗? <br><br> <br>来自: 衫菜, 时间: 2003-04-24 13:38:00, ID: 1798540 &nbsp;<br>碧血剑你把我害哭了, <br>上次我的问题到最后还是不行, <br>你说要把字段头一起倒出来到TXT中, <br>那BCP中没这个功能的啊 <br> <br>来自: 碧血剑, 时间: 2003-04-25 8:43:00, ID: 1800536 &nbsp;<br>to 衫菜 <br>被你打败了! <br>你可以自己在文本文件的第一行加上字段名呀!就几行语句可以搞定的事情! <br>变通一下,不要那么认死理儿。 <br>否则没有字段名,你的文本内容又是一连串的逗号,当然有问题了 <br><br> <br>来自: catfox, 时间: 2003-04-25 8:57:00, ID: 1800584 &nbsp;<br>衫菜的月薪很高的吧, 怎么...................... <br> <br>来自: 酷龙, 时间: 2003-04-25 9:29:00, ID: 1800754 &nbsp;<br>这个不错,厉害呀! <br> <br>来自: f2000, 时间: 2003-04-25 9:31:00, ID: 1800766 &nbsp;<br>要是有几万条数据 速度快不快 <br><br>Access 能和 SQLServer 用你的方法相互到动吗 <br> <br>来自: 衫菜, 时间: 2003-04-25 10:09:00, ID: 1800978 &nbsp;<br>to catfox: <br>这个现在讨论的是技术问题啊, <br>和月薪没多大关系的呀, <br>我现在是把SQLSERVER中的数据BCP到文本文件的, <br>所以是不可能加上表头字段的, <br>因为有些东西如果自己用那么怎么改也没关系, <br>有些数据和别人达成协议后是不能轻易改动的拉。 <br> <br>来自: catfox, 时间: 2003-04-25 10:23:00, ID: 1801058 &nbsp;<br>[:)] <br> <br>来自: wang_phoenix, 时间: 2003-04-25 10:27:00, ID: 1801081 &nbsp;<br>up studying!! <br> <br>来自: hyneter, 时间: 2003-04-25 11:40:00, ID: 1801489 &nbsp;<br>碧血剑兄: <br> &nbsp; &nbsp;我是菜鸟,在SQLServer 2000 中导出到TXT文档还无法完成。 <br> &nbsp; &nbsp;我的连接:Provider=SQLOLEDB.1;Persist Security Info=True;User ID=sa; <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Data Source=HYNETER //HYNETER此为SQLServer服务器名称。 <br> &nbsp; &nbsp;我的语句:ADOConnection1.Execute('Select * into [Text;Database=c:/temp;TabDelimited].test.txt from table'); <br> &nbsp; &nbsp;错误提示:数据库 'Text;Database=c:/temp;Tabdelimited' 不存在。 <br> 请再指教! <br><br> <br>来自: XdxDaxiong, 时间: 2003-04-26 18:10:00, ID: 1805655 &nbsp;<br>碧血剑兄: <br><br>SELECT * into tpSplib <br>FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', <br> 'Data Source=&quot;e:/XdxMarket&quot;;User ID=Admin;Password=;Extended properties=dBase 5.0')...tpSplib <br><br>这有正确吗?Help Help Me。 <br> &nbsp;Email:XdxDaxiong@163.com <br> &nbsp; &nbsp;MSN:2718060@163.com <br> &nbsp; &nbsp; QQ:59745865 <br>望回音。 <br> <br>来自: kris_ren, 时间: 2003-04-26 21:21:00, ID: 1805955 &nbsp;<br>要用编程实现sqlserver到oracle的数据转移该怎么办呢?切楼主解答 <br> <br>来自: tohappy, 时间: 2003-04-27 8:12:00, ID: 1806411 &nbsp;<br>关注下列问题,一定对你有益: <br>http://delphibbs.com/delphibbs/dispq.asp?lid=1743719 <br>http://delphibbs.com/delphibbs/dispq.asp?lid=1742072 <br>http://delphibbs.com/delphibbs/dispq.asp?lid=1655569 <br>http://delphibbs.com/delphibbs/dispq.asp?lid=1786356 <br> <br>来自: Radeon, 时间: 2003-04-29 23:51:00, ID: 1815820 &nbsp;<br>碧血剑兄: <br> 用什么方法在一个Access2000中打开另一个Access2000库(有密码,但密码已知)中的表。 <br>在程序中实现。 <br> <br>来自: down186, 时间: 2003-04-30 9:54:00, ID: 1816426 &nbsp;<br>up <br> <br>来自: xiamouse, 时间: 2003-04-30 11:06:00, ID: 1816859 &nbsp;<br>to 楼主 <br> &nbsp;能不能帮我决解这个问题:http://delphibbs.com/delphibbs/dispq.asp?lid=1797588 <br>我的文本格式是用‘|’线分隔的,‘|’与‘|’之间是一个字段 <br>如:aaaa|bbb|cccc|dddd| <br> &nbsp; aaa|bbb|c|ddd| <br><br> <br>来自: DuckJoe_1, 时间: 2003-05-08 10:36:00, ID: 1839321 &nbsp;<br>thx <br> <br>来自: chunming, 时间: 2003-05-15 11:07:00, ID: 1862827 &nbsp;<br>ADOConnection.Connected := True; <br>ADOConnection.Execute('Select * Into abcd From [Text;Database=c:/temp].aaaa.txt'); <br>用这个方法,是不是一定要先有schema.ini配置文件? <br><br>还有 <br>ADOConnection1.Execute('Select * into [Text;Database=c:/temp;TabDelimited].test.txt from table <br>在Test.txt存在时就会出错,而且,即使指定TabDelimited,出来的结果还是一“,”分隔 <br><br>另外从Text或Excel到Oracle还是没有成功,我做的两个例子有什么问题?: <br>1、ADOConnection1.Execute('select * into [text:Database=E:/TEST].TEST.txt from mara'); <br>结果是出错,信息为:“Invalid Character”。 <br>这个可以理解:Oracle不支持Select into。 <br><br>2、ADOConnection1.Execute('create table [text:Database=E:/TEST].TEST.txt as select * from mara'); <br>错误信息为:“Invalid Table Name” <br><br>错在哪里?请已经有成功经验的朋友说说看,谢谢! <br> <br>来自: 左右手, 时间: 2003-05-16 16:28:00, ID: 1867726 &nbsp;<br>别说ORACLE了,我拿access都没试成功 <br>ADOConnection.Connected := True; <br>ADOConnection.Execute('Select * Into abcd From [Text;Database=c:/temp].aaaa.txt'); <br>结果出错告诉我from子句里有语法错误,偶可是拷过去的,应该没什么错的,哪位调通了的给指点一下。 <br><br> <br>来自: 左右手, 时间: 2003-05-19 11:16:00, ID: 1873890 &nbsp;<br>呵呵,access终于试成功了,不过其他数据库还在实验中,哪位仁兄有试通了oracle和informix的请给个例子 <br> <br>来自: 左右手, 时间: 2003-05-21 10:20:00, ID: 1880668 &nbsp;<br>informix的也已经搞定了,20多万条数据,用了几分种就搞定了,速度确实快。 <br>就是oracle还是不成功 <br>1.连接指向oracle <br>执行:select * into [text:Database=C:/].test.txt &nbsp;from gds_order <br>出错:missing keyword,不知道是什么意思,怎么也调不同 <br>2.连接指向txt文件,ODBC是指向oracle的 <br>执行:insert into test.txt select * from gds_order <br>in [ODBC][ODBC;DSN=hbqzb;UID=hbqzb;PWD=hbqzb;Persist Security Info=True] <br>出错:告诉找不到gds_order这个表,可这个表绝对存在,而且名字没写错。 <br>哪位试通了的话,给个说明,多谢了。 <br> <br>来自: hyneter, 时间: 2003-05-21 11:50:00, ID: 1881240 &nbsp;<br>左右手:SQL的搞定了吗?给个例子,指点一下如何? <br> <br>来自: 左右手, 时间: 2003-05-21 16:38:00, ID: 1882563 &nbsp;<br>楼上的,你是问SQLSERVER的吗?我还没试,因为我在单位的机器上没装 <br>给你一个informix到access的例子,应该是一样的,你先拿去试试,如果不行的话,我再拿 <br>回家在SQLSERVER上试试,你试通了记得告诉我,我就懒的再试了:) <br>连接指向access,执行下面语句,就可以把dsn所指向的informix的数据写进access中 <br>insert into gds_order select * from gds_order <br>in [ODBC][ODBC;dsn=jbcmis;User Name=informix;password=informix;] <br><br><br>oracle的有谁弄出来了,能否给个例子? <br> <br>来自: trojans, 时间: 2003-05-21 17:37:00, ID: 1882927 &nbsp;<br>用ADO进行SQLSERVER转TXT不能,似乎是因为ADO不支持Microsoft Text Driver引擎, <br>看来要转的话不能用ADO了 <br> <br>来自: hyneter, 时间: 2003-05-21 20:53:00, ID: 1883443 &nbsp;<br>左右手:我指的是从SQLSERVER转到TXT文件,我还没有试成功。如果你试OK请给个例子,先谢了! <br> <br>来自: 左右手, 时间: 2003-05-22 8:54:00, ID: 1884066 &nbsp;<br>好,偶晚上回去试试。 <br>昨天回去试了SQLSERVER转到access的,连接指向SQLSERVER,用opendatasource到是可以 <br>查出access的数据,但是似乎有点问题,因为我的access里有二十多个字段,可是只查出 <br>来最后面的5个字段,其他字段都没有,不知道是什么原因? <br> <br>来自: dlink, 时间: 2003-05-22 9:08:00, ID: 1884130 &nbsp;<br>---------------------------------------------- <br>╭⌒╭⌒╮╭⌒╮~╭⌒╮ <br>╬ ╱◥███◣╬╬╬╬╬╬╬╬╬╬╬ <br>╬ ︱田︱田 田 ︱          ╬ <br>---------------------------------------------- <br><br><br><br>╲█◤ &nbsp; &nbsp; &nbsp; &nbsp; <br>◢██◣ <br> ◤◥ &nbsp; <br> &nbsp; &nbsp; &nbsp; &nbsp;<br><br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ///|/// <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // &nbsp;- - &nbsp;// <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;( &nbsp;@ @ &nbsp;) <br> &nbsp; +---------------------oOOoo-(?)ooOOo---------------------+ <br> &nbsp; | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| <br> &nbsp; | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| <br> &nbsp; | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Ooooo &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| <br> &nbsp; +-----------------------ooooO--( &nbsp; )---------------------+ <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ( &nbsp; ) &nbsp; )|/ <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/|( &nbsp; (_/ <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /_) <br><br><br><br> &nbsp; &nbsp; (&quot;`-''-/&quot;).___..--''&quot;`-._ <br> &nbsp; &nbsp; &nbsp;`6_ 6 &nbsp;) &nbsp; `-. &nbsp;( &nbsp; &nbsp; ).`-.__.`) <br> &nbsp; &nbsp; &nbsp;(_Y_.)' &nbsp;._ &nbsp; ) &nbsp;`._ `. ``-..-' <br> &nbsp; &nbsp;_..`--'_..-_/ &nbsp;/--'_.' ,' <br> &nbsp; (il),-'' &nbsp;(li),' &nbsp;((!.-' <br> <br>来自: 碧血剑, 时间: 2003-05-22 14:06:00, ID: 1885579 &nbsp;<br>to hynetey <br>将SQLServer导入到文本文件 <br>连接串 <br>Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:/temp;Extended Properties=&quot;text;HDR=YES;&quot;;Persist Security Info=False <br>SQL语句 <br>SELECT * into aaa.txt &nbsp;FROM Tab1 IN [ODBC] <br>[ODBC;Driver=SQL Server;UID=sa;PWD=;Server=127.0.0.1;DataBase=Demo;] <br>要改变分隔符,可以修改 <br>Schema.ini文件。该文件中指明分割符,如: <br> &nbsp; [yourfile.txt] <br> &nbsp; ... <br> &nbsp; Format=Delimited(|) <br>更详细的例子可以参考:微软的Knowledge Base的文章:“Q149090 CC: How to Use Schema.ini for Accessing Text Data”和微软的Knowledge Base的文章:“Q187670 OWTO: Use RDO and ODBC Text Driver to Open a Delimited Text”。 <br><br> <br>来自: dlink, 时间: 2003-05-22 15:21:00, ID: 1885905 &nbsp;<br>请 碧血剑 高手指点一二 <br><br>是一个公安局的项目 <br>从Access 数据库中的一个表 有一百万条记录 <br>要导入Oracle 中 <br>其中:1 Access 数据库中的表 有相片 <br><br>怎样才能 效率高些 又稳固 <br><br><br> <br>来自: hyneter, 时间: 2003-05-22 15:58:00, ID: 1886103 &nbsp;<br>谢谢楼主---碧血剑!测试OK! <br>我在提出问题那为你加分,略表心意。 <br> <br>来自: 左右手, 时间: 2003-05-22 16:21:00, ID: 1886214 &nbsp;<br>to:碧血剑 <br>老兄,你终于又上来了,能否给说说oracle跟其他数据库怎么导数据,我搞了好几天了都不行 <br>另外上面我说的那个缺字段的问题不知道你碰到过没有,怎么解决? <br> <br>来自: seafox, 时间: 2003-05-25 11:16:00, ID: 1893123 &nbsp;<br>to:碧血剑 ,看看我的问题,急呀,帮帮我吧 <br>http://www.delphibbs.com/delphibbs/DispQ.asp?LID=1888275 <br> <br>来自: 笨鸟1号, 时间: 2003-05-25 14:30:00, ID: 1893545 &nbsp;<br>碧血剑兄: <br> &nbsp; &nbsp;我在服务器端使用 <br>procedure TForm3.Button1Click(Sender: TObject); <br>begin <br> Form3.adoquery1.Close; <br> Form3.adoquery1.SQL .clear; <br> Form3.adoquery1.SQL .add('select * into tj21'); <br> Form3.adoquery1.SQL .add('from OpenDataSource(''''Microsoft.Jet.OLEDB.4.0'''',''''Data Source=&quot;d:/&quot;;User ID=Admin;Password=;Extended properties=dBase 5.0'''')...tj21;'); <br> form3.adoquery1.execsql; <br>end; <br>运行时,报错:project project2.exe raised exception class EoleException with <br>message:第二行 'microsoft' 附近有语法错误。最近急用,请指教,不胜感激。 <br> <br>来自: twt_gd, 时间: 2003-05-25 15:52:00, ID: 1893682 &nbsp;<br>楼顶:若e:/share与sql server不在同一机器不行啊,该如何做? <br> <br>来自: XdxDaxiong, 时间: 2003-05-26 8:25:00, ID: 1894734 &nbsp;<br>笨鸟1号兄弟,OpenDataSource是要数据库是同一机上运行。 <br> <br>来自: hrc378, 时间: 2003-05-26 12:57:00, ID: 1895873 &nbsp;<br>楼主好,我是一个初学者,请多多帮忙,我想把一个TXT文件的数据(SQL2000备份数据的格式) <br>导入到SQL2000里面,这样的语句好像不行,请多指教! <br>ADOConnection1.Connected := True; <br>ADOConnection1.Execute ('Select * Into aaa From <br>[Text;Database=c:/111].JURY_FILE_FORMAT_TABLE.txt'); <br>数据库名字aaa,文件名为JURY_FILE_FORMAT_TABLE.txt <br> <br>来自: 碧血剑, 时间: 2003-05-30 10:34:00, ID: 1908679 &nbsp;<br>to 笨鸟1号 <br>把你的SQL语句在查询分析器里执行,就能发现你的语句错误了。 <br>to hrc378 <br>应该是 <br>SELECT * into bmk <br>FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', <br>'Data Source=&quot;e:/share&quot;;User ID=Admin;Password=;Extended properties=Text')...bmk <br><br>另外最近很多人给我发来此问题邮件,由于比较忙 <br>所以未能一一回复,请见谅! <br>还有来信最好发来你认为有问题例子代码。 <br>谢谢大家的关注。 <br><br> <br>来自: sing_cee, 时间: 2003-05-30 11:16:00, ID: 1908881 &nbsp;<br>哪里有SQL SERVER2000下,如果下载成功送100分。 <br> <br>来自: hrc378, 时间: 2003-05-30 11:41:00, ID: 1908998 &nbsp;<br>楼主, 你给我程序不行,我用的是文本文件的数据库数据,并不是ACCESS数据库! <br><br> <br>来自: sing_cee, 时间: 2003-05-30 14:24:00, ID: 1909628 &nbsp;<br>我要作的一个可以把固定格式的EXCEL表导入SQLSERVER 考虑到对数据进行完整性检查 想通过一个临时表中转, 那位朋友有类似经验 给点代码看看 &nbsp;送100分 谢谢 <br>ndsmail@etang.com <br><br> <br>来自: 碧血剑, 时间: 2003-05-30 20:04:00, ID: 1910787 &nbsp;<br>to hrc378 <br>你试了吗?就说不行! <br>你不知道文本文件可以用Jet4引擎存取吗? <br> <br>来自: 笨鸟1号, 时间: 2003-05-31 21:49:00, ID: 1913380 &nbsp;<br>TO 碧血剑 <br>楼主,你好。你说的方法我在查询分析器里,能行。可是在QUERY.SQL.ADD(),EXEXSQL(). <br>老出错。所以想你请教。到底应该怎么样写才正确。我在同一台机上运行的。就是服务器端 <br>也会出错,我连的本机的SQL SEVER 数据库。 <br> <br>来自: flywing, 时间: 2003-05-31 22:27:00, ID: 1913446 &nbsp;<br>to 碧血剑: <br> &nbsp; 能否给个SQL server 导出到DBF格式的例子? <br> <br>来自: 碧血剑, 时间: 2003-06-03 11:08:00, ID: 1920186 &nbsp;<br>to 笨鸟1号 <br>你用ADOConnection.Execute()执行那个SQL语句 <br>to flywing <br>sql server导出到DBF <br>ADOConnection 指向DBF用Jet4连接 <br>SELECT * into table &nbsp;FROM Tab1 IN [ODBC] <br>[ODBC;Driver=SQL Server;UID=sa;PWD=;Server=127.0.0.1;DataBase=Demo;] <br><br> <br>来自: flywing, 时间: 2003-06-03 14:22:00, ID: 1920999 &nbsp;<br>to 碧血剑: <br>Jet4是指向Access的吧,另外:DBF文件开始不存在,导出时生成的。 <br>烦劳!! <br> <br>来自: henry_shu2000, 时间: 2003-06-03 22:57:00, ID: 1922515 &nbsp;<br>真的很高兴有各位的讨论,我正在解决此问题! <br> <br>来自: 碧血剑, 时间: 2003-06-04 12:16:00, ID: 1923688 &nbsp;<br>to flywing <br>Jet4指向DBF的路径 <br> <br>来自: 高守, 时间: 2003-06-04 12:21:00, ID: 1923704 &nbsp;<br>这个方法,很久以前我就在使用了有兴趣的朋友可以跟我联系 <br>QQ:44600694 <br> <br>来自: zklcy, 时间: 2003-06-05 13:18:00, ID: 1927216 &nbsp;<br>有问题啊!连接本地的数据库可以执行 <br>SELECT * into bmk <br>FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', <br>'Data Source=&quot;e:/share&quot;;User ID=Admin;Password=;Extended properties=dBase 5.0')...bmk <br>语句,可是连接远程的数据库就会报错! <br>原因是该sql语句在服务器端执行,而OpenDataSource中的Data Source所连接的是本机上的路径,服务器端根本没这个文件。 <br>有没有其他的什么方法解决远程数据的导入导出问题 <br> <br>来自: app2001, 时间: 2003-06-08 14:41:00, ID: 1934539 &nbsp;<br>TO 碧血剑 <br> 授人以鱼不如授人以渔,还请老兄整理一下自己找出这些方法的经验,如那些各式类型数据库的导入导出在OpenDataSource函数中的各式参数该如何定义,又在哪有这样的文献资料,让大家学习学习,自己吸收,企不胜过老师一一亲手指点,更为有益及方便大家,也省了老兄好多精力,你觉得如何呢? <br> <br>来自: zbsfg, 时间: 2003-06-08 19:29:00, ID: 1934951 &nbsp;<br>这个问题害得我想了好几天,后来还是不能用SQL实现,后来只能用ACCESS的DOCMD解决,但对SQLSERVER就没办法了,这个办法我要收藏. <br> <br>来自: zbdeng, 时间: 2003-06-09 10:58:00, ID: 1936080 &nbsp;<br>从oracle导数据出来,应该注意表名要大写。 <br> <br>来自: lescape, 时间: 2003-06-09 11:42:00, ID: 1936268 &nbsp;<br>To 碧血剑 <br>请问:如何用SQL语句将一个自由表(DBF)转成Excel文件,望赐教,万分感谢!! <br> <br>来自: poppy, 时间: 2003-06-10 6:35:00, ID: 1938521 &nbsp;<br>太谢谢碧血剑了 <br> <br>来自: huddle, 时间: 2003-06-10 15:06:00, ID: 1939821 &nbsp;<br>zhbforce的办法不行啊 <br>测试不成功,报错 <br>ODBC--连接到'...'失败 <br><br>我odbc设置好了,而且打得开数据库的 <br>请指教,谢谢 <br> <br>来自: wdlyc, 时间: 2003-06-10 15:06:00, ID: 1939883 &nbsp;<br>很好 thx <br> <br>来自: huddle, 时间: 2003-06-10 15:08:00, ID: 1939890 &nbsp;<br>各位帮忙讨论啊,成果一起分享 <br>我会另开贴算分的,请多帮忙 <br> <br>来自: ndyufei, 时间: 2003-06-10 15:19:00, ID: 1939930 &nbsp;<br>to Huddle: <br>cn.Execute('SELECT * into &nbsp;test01 FROM JSBB1 in [ODBC]'+ <br> &nbsp; &nbsp; &nbsp; '[ODBC;dsn=myora;uid=scott;pwd=tiger]'); <br> <br>来自: huddle, 时间: 2003-06-10 15:23:00, ID: 1939953 &nbsp;<br>to 楼上 <br>我一开始就是照这个试的,总报错 连接失败 <br> <br>来自: delfish, 时间: 2003-06-10 15:34:00, ID: 1940023 &nbsp;<br>浠ュ墠鎴戝氨鐢ㄨ繃鐨勶紝璁稿?璁ㄨ?ado璁哄潧閮芥湁绫讳技鐨勭敤娉曪紝涓嶈繃浣犲湪杩欓噷璐村嚭锛岃繕鏄?彲浠ュ畾涔変笅鐨勩? <br> <br>来自: fz97535, 时间: 2003-06-10 15:45:00, ID: 1940078 &nbsp;<br>给大家 报告一下 测试结果:用楼主的方法 <br>一个公安系统的数据 Acess数据库 &nbsp;300 M <br>一百多万条记录 到出到文本文件中 <br>用了 5 分中 <br>文本文件有 200 多 M <br><br>比较爽 &nbsp; <br> <br>来自: huddle, 时间: 2003-06-10 16:28:00, ID: 1940299 &nbsp;<br>oracle=&gt;access的导出,有谁成功吗,请发个例子给我,我另开贴100分,谢谢 <br> <br>来自: 寒天红叶, 时间: 2003-06-11 16:44:00, ID: 1943601 &nbsp;<br>我设置了一个odbc数据源con,它用来连接mysql数据库,我现在要将mysql中snort0数据库中的tmps表的内容导入到sqlserver,请问如何做? <br> <br>来自: fz97535, 时间: 2003-06-12 16:15:00, ID: 1946814 &nbsp;<br>---------------------------------------------- <br>╭⌒╭⌒╮╭⌒╮~╭⌒╮ <br>╬ ╱◥███◣╬╬╬╬╬╬╬╬╬╬╬ <br>╬ ︱田︱田 田 ︱          ╬ <br>---------------------------------------------- <br>╲█◤ &nbsp; &nbsp; &nbsp; &nbsp; <br>◢██◣ <br> ◤◥ &nbsp; <br> &nbsp;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ///|/// <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // &nbsp;- - &nbsp;// <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;( &nbsp;@ @ &nbsp;) <br> &nbsp; +---------------------oOOoo-(?)ooOOo---------------------+ <br> &nbsp; | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| <br> &nbsp; | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| <br> &nbsp; | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Ooooo &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| <br> &nbsp; +-----------------------ooooO--( &nbsp; )---------------------+ <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ( &nbsp; ) &nbsp; )|/ <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/|( &nbsp; (_/ <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /_) <br><br> &nbsp; &nbsp; (&quot;`-''-/&quot;).___..--''&quot;`-._ <br> &nbsp; &nbsp; &nbsp;`6_ 6 &nbsp;) &nbsp; `-. &nbsp;( &nbsp; &nbsp; ).`-.__.`) <br> &nbsp; &nbsp; &nbsp;(_Y_.)' &nbsp;._ &nbsp; ) &nbsp;`._ `. ``-..-' <br> &nbsp; &nbsp;_..`--'_..-_/ &nbsp;/--'_.' ,' <br> &nbsp; (il),-'' &nbsp;(li),' &nbsp;((!.-' <br><br> <br>来自: annkie, 时间: 2003-06-14 16:24:00, ID: 1947660 &nbsp;<br>hao <br> <br>来自: annkie, 时间: 2003-06-14 16:25:00, ID: 1947736 &nbsp;<br>. <br> <br>来自: annkie, 时间: 2003-06-14 17:39:00, ID: 1952474 &nbsp;<br>这是什么意思? <br><br>“不能使用odbc来输入、输出或将一个外部Microsoft Jet或Isam数据库链接到你的数据库。“ <br> <br>来自: annkie, 时间: 2003-06-14 17:47:00, ID: 1952498 &nbsp;<br>我想从access导出到dbf,出现上面的问题,如何解决? <br>ADOConnection2.Execute('select * into hello from hello IN [ODBC] [ODBC;Driver={Microsoft Access Driver (*.mdb)};UID=Admin;PWD=;DBQ=c:/temp/test.mdb;]'); <br><br> <br>来自: JamesBond_L, 时间: 2003-06-14 17:54:00, ID: 1952509 &nbsp;<br>UP,以前试过,但是不行,这个行的吗?UP <br> <br>来自: annkie, 时间: 2003-06-14 18:07:00, ID: 1952539 &nbsp;<br>解决了,我用的cb <br>/* <br>功能 : &nbsp;Access To DBF <br>ADOConnection2 =&gt; Access <br>*/ <br>sql = &quot;SELECT * INTO jyjh in /&quot;c://temp/&quot;[dbase 5.0;] FROM jyjh&quot;; <br>ADOConnection2-&gt;Execute(sql); <br> <br>来自: annkie, 时间: 2003-06-14 19:46:00, ID: 1952709 &nbsp;<br>To 碧血剑: <br> &nbsp;你发给我的例子没有收到,麻烦你再发一次。另外我刚来这里,不晓得怎么发短消息,麻烦告诉我一下怎么发,谢谢了。annkie@163.com <br> <br>来自: mark_yjh, 时间: 2003-06-14 20:19:00, ID: 1952754 &nbsp;<br>写得不错:我来讲下 &nbsp; <br> &nbsp;我们公司现在用的是mysql表大约在200多个 <br> &nbsp;每个表大记录大于在100000,有的表更多 <br> &nbsp;现在公司要求在最短时间转换成为oracle <br> &nbsp;如何做: <br> &nbsp;一:我人试过把mysql的记录转换成txt 但是oracle的日期字 是不认的; <br> &nbsp;2 mysql中的表的类型和oracel是不相同的:如何能转换类形 如mysql中的text 在oracle中是没有的: <br> &nbsp; &nbsp;mysql中的datetime 在oracle中可统一叫date在9.i中出现在很多新的日期类形:但是对于文本格式是不认的 <br> &nbsp;我在oracle 中还没有建表:我如何做 <br> &nbsp;我不可能用sql来完成这些工作:当时我想到oracle的p-sql来完成。但是发现有很多数据不对的地方; <br> &nbsp;所以我写了一个程序:是一个mysql to oracle的工具: <br> &nbsp;代码很少:只有100多行,成了建表数据,数据倒入的兼容性的认计。 <br> &nbsp;讲起快不快:那不好讲,只用了大于10分钟时间:大于每秒处理475个记录 <br> &nbsp;我会在源码空间发布; <br><br><br><br><br><br><br><br> &nbsp;<br><br> <br>来自: trojans, 时间: 2003-06-17 10:42:00, ID: 1958190 &nbsp;<br>To 碧血剑: <br>请问有没有OpenDataSourc的详细说明,另外下面语句无法执行,不明白最后面的&quot;...bmk&quot;是干什么用的 <br>SELECT * into bmk <br>FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', <br>'Data Source=&quot;e:/share&quot;;User ID=Admin;Password=;Extended properties=Text')...bmk <br><br><br> <br>来自: trojans, 时间: 2003-06-17 11:02:00, ID: 1958311 &nbsp;<br>另外,谁知道这个错是怎么回事? <br>[Microsoft][ODBC SQL Server Driver][SQL Server][OLE/DB provider returned message:]无法启动应用程序。工作组信息文件丢失,或是已被其他用户以独占方式打开 <br> <br>来自: mark_yjh, 时间: 2003-06-17 13:54:00, ID: 1958990 &nbsp;<br>我已在源码空间发布; <br><br> <br>来自: huddle, 时间: 2003-06-17 14:10:00, ID: 1959034 &nbsp;<br>mark_yjh: <br>发在哪里,找不到,给个链接吧,谢了 <br> <br>来自: 星空, 时间: 2003-06-17 16:25:00, ID: 1959535 &nbsp;<br>将Oracle导入到文本文件 <br>连接串 <br>Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:/temp;Extended Properties=&quot;text;HDR=YES;&quot;;Persist Security Info=False <br>SQL语句 <br>SELECT * into aaa.txt &nbsp;FROM Tab1 IN [ODBC] <br>[ODBC;Driver={Microsoft ODBC for Oracle};UID=oracle;PWD=oracle;SERVER=yourdata;] <br><br>将Oracle导入到Access <br>连接串 <br>Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:/temp/db1.mdb;Persist Security Info=False <br>SQL语句 <br>SELECT * into tablename &nbsp;FROM Tab1 IN [ODBC] <br>[ODBC;Driver={Microsoft ODBC for Oracle};UID=oracle;PWD=oracle;SERVER=yourdata;] <br><br><br> <br>来自: stargazer, 时间: 2003-06-17 17:01:00, ID: 1959719 &nbsp;<br>好贴,不应沉底,顶一下以示支持。 <br> <br>来自: wchal, 时间: 2003-06-17 19:06:00, ID: 1960152 &nbsp;<br>TO:各位 <br>SQL--EXCEL 好像不可以使用临时表. <br>如果我要转换表中的一部分记录不就不可以了. &nbsp; <br> <br>来自: yyhua, 时间: 2003-06-17 21:07:00, ID: 1960424 &nbsp;<br>TO:碧血剑 <br>使用ado,从oracle导入到sql server能否使用你所说的方法 <br> <br>来自: 碧血剑, 时间: 2003-06-18 9:41:00, ID: 1961165 &nbsp;<br>to &nbsp; <br>to 星空 <br>谢谢跟贴 <br>to yyhua <br>你的问题最好用建立链接服务器的方法解决, <br>但是用OpenDataSource,OpenRowSet也应该可以查询 <br>但是我的大硬盘坏了,没法装Oracle,不能帮你试 <br><br> <br>来自: lhl20000, 时间: 2003-06-18 11:26:00, ID: 1961654 &nbsp;<br>to :碧血剑 <br>你好: <br>我想问一问:interbase 服务器用SQL语句不能实现 <br>从文本文件到*.gdb的转化吗? <br>但是 <br>Insert INTO [Text;DATABASE=c:/temp;TabDelimited].[ee.txt] FROM SYSTEST_NUMBER_MANAGE <br>这句将数据库记录导出到文本文件根本就不行,提示SQL语句有错误。 <br>有解决的办法吗?请指教。 <br><br><br><br><br><br> <br>来自: searoom, 时间: 2003-06-19 11:08:00, ID: 1964759 &nbsp;<br>lhl20000: <br><br>你要记住这样一件事: <br>你往什么里面导数据,那么就让 sql 语句在其相应的 driver 里面执行 <br>也就是说,如果你往 文本文件 里面导数据的话,那么就让你的 AdoConnection 指向该文本文件,(当然,其driver是 jet) <br><br> <br>来自: jyz_1006, 时间: 2003-06-19 16:44:00, ID: 1966141 &nbsp;<br>to 碧血剑大侠: <br>想把文本文件导入到ACCESS数据库,用你的方法可以实现, <br>ADOConnection.Connected := True; <br>ADOConnection.Execute(’Select * Into abcd From [Text;Database=c:/temp].aaaa.txt’); <br> &nbsp; 但是若abcd已存在则报错,不知试了没有? <br> &nbsp; 我单位每月都有数据传来(用逗号分开的文本文件),我是想把数据添加到库的表中, <br>而不是每月建一新表,怎么做?请赐教!谢谢! <br> <br>来自: chinausa, 时间: 2003-06-21 20:22:00, ID: 1971202 &nbsp;<br>碧血剑: <br> &nbsp;将Access 2000中的一个表的内容导入到 另一个 ACCESS 2000的 一个表中,如何导?? <br>有代码吗? <br> <br>来自: hualex, 时间: 2003-06-21 22:18:00, ID: 1971368 &nbsp;<br>收藏此帖。仁兄果然历害。 <br> <br>来自: ccweifen, 时间: 2003-06-22 11:14:00, ID: 1971838 &nbsp;<br>还是没明白如何将 SQL Server中的数据导出到EXCEL 中, <br>请高手指点 <br> <br>来自: chinausa, 时间: 2003-06-23 18:18:00, ID: 1974969 &nbsp;<br>碧血剑: <br> 将Access 2000中的一个表的内容导入到 另一个 ACCESS 2000的 一个表中,如何导?? <br>有代码吗? &nbsp; <br> <br>来自: 碧血剑, 时间: 2003-06-23 19:01:00, ID: 1975057 &nbsp;<br>to jyz1006 <br>你的邮件已回复 <br>to chinausa <br>这种导入是最简单的 <br>SQL语句 &nbsp;select * into aaa from aaa in 'c::/temp/b.mdb' <br>用ADOConnection.Execute执行 <br> <br>来自: luky_99, 时间: 2003-06-23 21:00:00, ID: 1975263 &nbsp;<br>TO 碧血剑: <br>ADOConnection.Connected := True; <br>ADOConnection.Execute('Select * Into abcd Fro[Text;Database=c:/temp].aaaa.txt'); <br><br>我用這條不行呀。說什麼 <br>Invalid Object name'text;database=c:/aa.DBA.txt' <br><br> <br>来自: gaolang2, 时间: 2003-06-23 23:42:00, ID: 1975556 &nbsp;<br>study <br> <br>来自: 宁静蝴蝶, 时间: 2003-06-24 14:34:00, ID: 1977070 &nbsp;<br>学习啊!!学习的机会在这儿.[:D] <br>IF 不用ADO,用BDE如何导出,[?] <br>IF 不导出全表,只是满足条件的部分数据.[?] <br>请教各位!!!! <br>[:)][:)][:)] <br><br><br> <br>来自: 宁静蝴蝶, 时间: 2003-06-24 14:42:00, ID: 1977084 &nbsp;<br>补充一下:是从数据库:ORACLE或Paradox 7.X导出至EXCEL <br>[:)] &nbsp; &nbsp; &nbsp; [:)] <br> <br>来自: nullx, 时间: 2003-06-24 14:57:00, ID: 1977148 &nbsp;<br>要条件限制还不容易,加个 where xxx like xxx 就行了嘛 <br> <br>来自: dcsdcs, 时间: 2003-06-24 15:03:00, ID: 1977166 &nbsp;<br>我早就这样了! <br>注意:这里的路径必须是服务器上面的! <br>对foxpro 6.0采取odbc,建立一个数据源 <br>insert into t_d(申请日期,发票序号,序号,日期,发票号,发票种类,发货单id,申请单编号,片区,部门,销售员,客户代码,客户单位,开票名称,客户邮编,客户地址,客户电话,客户税号,客户开户行,客户帐号,开票单位,邮编,地址,电话,税号,开户行,帐号,编号,品名,规格,单位,单价,数量,金额,不含税单价,不含税金额,税额,底价,税率,税率1,红票金额,红票号,发票收件人,收件人地址,收件人电话,收件人邮编,备注,打印标志,制单,复核,审核,标志1,标志,管理模式,警示标志,结算单价,结算标准,扣率,冲减金额,回款金额,少回款,回款差额,欠款金额,欠款数量,来款单序号,主管部门,退票标志,退票日期,发货日期,申请号) <br>SELECT 申请日期,发票序号,序号,日期,发票号,发票种类,发货单id,申请单编号,片区,部门,销售员,客户代码,客户单位,开票名称,客户邮编,客户地址,客户电话,客户税号,客户开户行,客户帐号,开票单位,邮编,地址,电话,税号,开户行,帐号,编号,品名,规格,单位,单价,数量,金额,不含税单价,不含税金额,税额,底价,税率,税率1,红票金额,红票号,发票收件人,收件人地址,收件人电话,收件人邮编,备注,打印标志,制单,复核,审核,标志1,标志,管理模式,警示标志,结算单价,结算标准,扣率,冲减金额,回款金额,少回款,回款差额,欠款金额,欠款数量,来款单序号,主管部门,退票标志,退票日期,发货日期,申请号 <br>from <br>OPENROWSET('MSDASQL', <br>'dsn=ddd;SourceDB=e:/d_pro/mail/poprec;SourceType=DBF' <br>,'select * from E:/d_pro/mail/poprec/d.dbf') as a --where 发票号 not in(select 发票号 from t_d) <br><br> <br>来自: Pc 狂迷, 时间: 2003-06-24 15:10:00, ID: 1977196 &nbsp;<br>大家试过这句了吗? <br>导入文本: <br>BULK INSERT DM.dbo.testest FROM 'F:/Test.TXT' <br>WITH <br>( <br> FIELDTERMINATOR = '|', <br>-- '|' 为分隔符 <br><br> ROWTERMINATOR = '/n' <br>-- '/n' 为断行符 <br>) <br><br>另外,先生成 &nbsp;DTS ,然后在 DELPHI 中调用 .dts 是最好的导入导出方法,而且灵活。 <br> <br>来自: Pc 狂迷, 时间: 2003-06-24 15:11:00, ID: 1977200 &nbsp;<br>大家试过这句了吗? <br>导入文本: <br>BULK INSERT DM.dbo.testest FROM 'F:/Test.TXT' <br>WITH <br>( <br> FIELDTERMINATOR = '|', <br>-- '|' 为分隔符 <br><br> ROWTERMINATOR = '/n' <br>-- '/n' 为断行符 <br>) <br><br>另外,先生成 &nbsp;DTS ,然后在 DELPHI 中调用 .dts 是最好的导入导出方法,而且灵活 <br> <br>来自: 啊啊啊啊啊, 时间: 2003-06-24 22:25:00, ID: 1978410 &nbsp;<br>我按楼主的办法试了试,txt导入access成功了,但有个问题:要加入数据的表必须是不存在的,在程序运行时创建,否则提示表已存在! <br><br>另外希望楼主详细介绍一下,如何把excel导入到access中,我用楼主的办法试了,程序没反应,还结束不了 <br> <br>来自: huddle, 时间: 2003-06-25 15:49:00, ID: 1979983 &nbsp;<br>楼主碧血剑 和 星空 : <br>请到 <br>http://www.delphibbs.com/delphibbs/dispq.asp?lid=1979971 <br>拿分,顺便帮我解决个问题,谢谢 <br> <br>来自: songmk, 时间: 2003-06-29 15:46:00, ID: 1988862 &nbsp;<br>收藏 <br> <br>来自: 江江, 时间: 2003-07-02 19:49:00, ID: 1997991 &nbsp;<br>各位好, <br> &nbsp;我也遇到此类问题,在这里找到了方法,很兴奋. <br> &nbsp;但是我从paradox型数据库导出.txt文件时执行下面的语句出错: <br>adoconnection1.Execute('select * into [Text;database=d:/].car_bz.txt from car_bz '); <br>运行时说我[odbc paradox 驱动程序]查询输入必须包含至少一个表或查询. <br>这是为什么,我就是想将car_bz表中的数据导出成.txt文件.应该怎么写啊?请大家帮帮我! <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;江江 <br> <br>来自: huddle, 时间: 2003-07-03 8:52:00, ID: 1998554 &nbsp;<br>从oracle导到oracle有没有人成功过 <br>不同的数据库之间 <br>说说怎么做的,谢谢 <br> <br>来自: jjchen123, 时间: 2003-07-03 11:25:00, ID: 1999146 &nbsp;<br>TO 碧血剑: <br>你的方法很好很快,但是得出的文本文件的第一行是有字段标致的, <br>而且我要的导出导入格式都是定好的又如何处理呢? <br>我已前是用循环写入文本的,有没有其他更好的方法呢?[:D] <br>如: <br>id &nbsp; &nbsp; xm &nbsp; &nbsp; gz <br>------------------------------ <br>1 &nbsp; &nbsp; &nbsp;张小三 &nbsp; 1000 <br>2 &nbsp; &nbsp; &nbsp;李四 &nbsp; 20 <br>3 &nbsp; &nbsp; &nbsp;王五 &nbsp; 300 <br>文本格式 <br>1 &nbsp;张小三 &nbsp;1000 <br>2 &nbsp; &nbsp;李四 &nbsp;20 <br>3 &nbsp; &nbsp;王五 &nbsp;300 <br> <br>来自: 碧血剑, 时间: 2003-07-03 16:33:00, ID: 2000330 &nbsp;<br>贴一段资料,可解决楼上问题 <br>使用 Schema.ini 檔來執行文字檔限制 <br>如果您不能改變文字檔來執行文字檔限制,您可以改用 Schema.ini 檔。Schema.ini 檔是一種包含可覆寫 Microsoft Windows 登錄中預設文字驅動程式設定值項目的文字檔。若要使用 Schema.ini 檔,請執行下列步驟: <br><br>儲存 Schema.ini 檔於目前正在連結的文字檔所在的資料夾中。 <br>將該檔案命名為 Schema.ini。 <br>在此 Schema.ini 檔案的第一行,鍵入正在連結文字檔的檔名,並用括號括住。 <br>範例:指定第一行資料行是資料 <br><br>[Products.txt] <br>ColNameHeader=False <br><br>範例:指定分號字元 (;) 作為分隔符號 <br><br>[Categories.txt] <br>Format=Delimited(;) <br><br>範例:指定具固定寬度的檔案和資料行寬度 <br><br>[Shippers.txt] <br>ColNameHeader=False <br>Format=FixedLength <br>Col1=ShipperID Text Width 11 <br>Col2=CompanyName Text Width 40 <br>Col3=Phone Text Width 24 <br><br>我使用了&quot;|&quot; 作为txt文件的分割符,但在txt文件取数据时,却是以&quot;,&quot;来读取数据的,请问如何设置。 <br> &nbsp; 答:如果你采用的是数据库方式读TXT文件,可以在TXT文件所在目录建立一个Schema.ini文件。该文件中指明分割符,如: <br> &nbsp; [yourfile.txt] <br> &nbsp; ... <br> &nbsp; Format=Delimited(|) <br> &nbsp; ... <br> &nbsp; 更详细的例子可以参考:微软的Knowledge Base的文章:“Q149090 CC: How to Use Schema.ini for Accessing Text Data”和微软的Knowledge Base的文章:“Q187670 OWTO: Use RDO and ODBC Text Driver to Open a Delimited Text”。 <br><br> <br>来自: newmoonfaw, 时间: 2003-07-04 16:20:00, ID: 2003333 &nbsp;<br>请问碧血剑: <br>1、如何在server上进行联表查询后导至本地数据库。 <br>2、如何在本地通过程序把服务器上的表与本地数据库进行查询?比方说本地数据库是Access数据库。 <br>关于1,我试过这样进行查询,但不成功。 <br>: <br>select a.id,a.citemcode as 物料号,a.nplanprice as 计划价,b.nOpenQua &nbsp;as 期初数量,a.nplanprice*b.nOpenQua as 期初金额,c.description as 库位名称,a.cDeptcode as 单位,rtrim(ltrim(a.citemname)) as 物料名称,a.cspecific as 规格,cmodel &nbsp;as 型号 <br><br>from inv_itemmaster a,inv_inventory_d as b,inv_location as c where a.id=b.ninvitemid and a.nitemtypeid=(select id from inv_itemtype where description like '%自制件%') and c.id= <br>a.nLocatId <br>in <br>[ODBC] <br>[ODBC;Driver=SQL Server;UID=sa;PWD=;Server=sqlserver;DataBase=fmez;] <br> <br>来自: jjchen123, 时间: 2003-07-04 16:23:00, ID: 2003355 &nbsp;<br>多谢碧血剑仁兄,小弟用以上的方法成功做出了数据的导出. <br>但还是有一个问题,为什么我导出字符形数据都带有双引号的, <br>有没有办法把引号也除去呢? <br> <br>来自: 宁静蝴蝶, 时间: 2003-07-04 19:05:00, ID: 2003950 &nbsp;<br>楼主: <br> &nbsp;您好!请问如何从数据库:ORACLE或Paradox 7.X导出至EXCEL表,能用QUERY来导出吗? <br>有代码吗?谢谢!!![:)] <br><br> <br>来自: 石头, 时间: 2003-07-04 19:38:00, ID: 2003980 &nbsp;<br>奉献型的高手,才是真正的高手! <br> <br>来自: Pc 狂迷, 时间: 2003-07-07 15:19:00, ID: 2009021 &nbsp;<br>导入分隔符为'|' 的文本时使用: <br>insert into MyFenDuan(ColA,ColB,ColC,ColD,ColE,ColF,ColG,ColH,ColI,ColJ,ColK,ColL,ColM,ColN) <br>Select * <br> from OpenRowset('MSDASQL', 'Driver={Microsoft Text Driver (*.txt; *.csv)}; <br> DefaultDir=F:/DATA;','select * from A.txt') <br>不行! 非要生成一个 内容为 <br>[A.txt] <br>ColNameHeader=False <br>Format=Delimited(|) <br>MaxScanRows=25 <br>CharacterSet=ANSI <br>Col1=F1 Integer <br>Col2=F2 Char Width 60 <br>Col3=F3 Char Width 80 <br>Col4=F4 Char Width 20 <br>Col5=F5 Char Width 20 <br>Col6=F6 Char Width 20 <br>Col7=F7 Char Width 20 <br>Col8=F8 Char Width 20 <br>Col9=F9 Char Width 20 <br>Col10=F10 Char Width 20 <br>Col11=F11 Char Width 20 <br>Col12=F12 Char Width 20 <br>Col13=F13 Char Width 20 <br>Col14=F14 Char Width 20 <br>Col15=F15 Char Width 20 <br>的 schema.ini 才行,苦恼。 <br><br>BULK INSERT DM.dbo.testest FROM 'F:/Test.TXT' <br>WITH <br>( <br> FIELDTERMINATOR = '|', <br> ROWTERMINATOR = '/n' <br>) <br>方便好用,但文本非要在服务器上才行,也苦恼。 <br><br> <br>来自: lyjgs.168, 时间: 2003-07-07 16:22:00, ID: 2009310 &nbsp;<br>学习, <br><br> <br>来自: gxswy, 时间: 2003-07-11 16:22:00, ID: 2021610 &nbsp;<br>我的问题是这样的,我的客户端是ACCESS数据库,服务器端是SQL SERVER。平常客户机只是对ACCESS操作,到下班前才将更新的数据提交给服务器,客户机和服务器是远程连接。这样的话我想做的就是先把ACCESS中的数据导出为一文本文件,将这个文本传递给服务器,然后服务器再把这个文本文件导入数据库。这样带来的一个问题是BATCHMOVE时要加上一个where 子句,但我怎么调整都不能通过,请高手指点。 <br>ADOConn_upload.execute('Select * Into [Text;Database=E:/].temp.txt From BillIndex where submit&gt;0 ') <br> <br>来自: xzzcq, 时间: 2003-07-12 13:20:00, ID: 2023753 &nbsp;<br>真的不错,感谢!!!!!! <br> <br>来自: playboy2002, 时间: 2003-07-12 19:45:00, ID: 2024516 &nbsp;<br>谁能不能把excel 导向sql2000的详细情况写清楚。谢谢了。 <br> <br>来自: HUANGPEIYAN, 时间: 2003-07-13 10:04:00, ID: 2025101 &nbsp;<br>整理一下: <br>解决了,我用的cb <br>/* <br>功能 : &nbsp;Access To DBF <br>ADOConnection2 =&gt; Access <br>*/ <br>sql = &quot;SELECT * INTO jyjh in /&quot;c://temp/&quot;[dbase 5.0;] FROM jyjh&quot;; <br>ADOConnection2-&gt;Execute(sql); <br><br>c:/temp/aaa.dbf to Access, <br>ADOConnection 指向Access <br>语句是 &nbsp;select * into bbb from aaa in 'c:/temp' 'dbase 5.0;' <br><br>在Form上放一个ADOConnection,连结指向目标Access库 <br>比如txt文件在c:/temp/aaaa.txt <br>就执行 <br>ADOConnection.Connected := True; <br>ADOConnection.Execute('Select * Into abcd From [Text;Database=c:/temp].aaaa.txt'); <br><br>将Oracle导入到文本文件 <br>连接串 <br>Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:/temp;Extended Properties=&quot;text;HDR=YES;&quot;;Persist Security Info=False <br>SQL语句 <br>SELECT * into aaa.txt &nbsp;FROM Tab1 IN [ODBC] <br>[ODBC;Driver={Microsoft ODBC for Oracle};UID=oracle;PWD=oracle;SERVER=yourdata;] <br><br>将Oracle导入到Access <br>连接串 <br>Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:/temp/db1.mdb;Persist Security Info=False <br>SQL语句 <br>SELECT * into tablename &nbsp;FROM Tab1 IN [ODBC] <br>[ODBC;Driver={Microsoft ODBC for Oracle};UID=oracle;PWD=oracle;SERVER=yourdata;] <br><br>DBase 5.0 <br>DBASE IV <br>FoxPro 3.0 <br>Paradox 7.X <br>Excel 8.0 <br>text;HDR=YES;FMT=Delimited <br><br>SELECT * into aaa <br>FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', <br>'Data Source=&quot;c:/temp/&quot;;User ID=Admin;Password=;Extended properties=Text')...[bb#txt] <br><br>Excel联接ADO串 <br>Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:/temp/a.xls;Extended <br>Properties=&quot;Excel 8.0;HDR=Yes;&quot;;Persist Security Info=False <br>Extended Properties参数属性这样写 Excel 5.0;HDR=YES;IMEX=1 <br>IMEX=1就是指混合型转换为文本 <br>SQLServer从Excel取数 <br>SELECT * <br>FROM OpenDataSource('Microsoft.Jet.OLEDB.4.0','Data Source=&quot;C:/temp/b.xls&quot;;Extended Properties=&quot;Excel 5.0;HDR=Yes;&quot;;Persist Security Info=False')...sheet1$ <br><br>将SQLServer导入到文本文件 <br>连接串 <br>Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:/temp;Extended Properties=&quot;text;HDR=YES;&quot;;Persist Security Info=False <br>SQL语句 <br>SELECT * into aaa.txt &nbsp;FROM Tab1 IN [ODBC] <br>[ODBC;Driver=SQL Server;UID=sa;PWD=;Server=127.0.0.1;DataBase=Demo;] <br>要改变分隔符,可以修改 <br>Schema.ini文件。该文件中指明分割符,如: <br> &nbsp; [yourfile.txt] <br> &nbsp; ... <br> &nbsp; Format=Delimited(|) <br>更详细的例子可以参考:微软的Knowledge Base的文章:“Q149090 CC: How to Use Schema.ini for Accessing Text Data”和微软的Knowledge Base的文章:“Q187670 OWTO: Use RDO and ODBC Text Driver to Open a Delimited Text”。 <br><br>txt导入SQLServer <br>select * from OpenRowset('MSDASQL', 'Driver={Microsoft Text Driver (*.txt; *.csv)}; <br>DefaultDir=c:/temp;','select * from aaaa.txt') <br><br>sql server导出到access <br>ADOConnection 指向Access <br>SELECT * into table &nbsp;FROM Tab1 IN [ODBC] <br>[ODBC;Driver=SQL Server;UID=sa;PWD=;Server=127.0.0.1;DataBase=Demo;] <br><br>sql server导出到excel <br>ADOConnection 指向excel, 用Jet4.0 ,Extended properties设为Excel 8.0 <br>SELECT * into table &nbsp;FROM Tab1 IN [ODBC] <br>[ODBC;Driver=SQL Server;UID=sa;PWD=;Server=127.0.0.1;DataBase=Demo;] <br><br>insert into gds_order select * from gds_order <br>in [ODBC][ODBC;dsn=jbcmis;User Name=informix;password=informix;] <br><br>用SQLServer连接DBF <br>在SQLServer中执行 <br>SELECT * into bmk <br>FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', <br> 'Data Source=&quot;e:/share&quot;;User ID=Admin;Password=;Extended properties=dBase 5.0')...bmk <br>这样就可以把e:/share中的bmk.dbf表导入到Sqlserver中, <br><br>Access 到 Access <br>select * into aaa from aaa in 'c::/temp/b.mdb' <br>用ADOConnection.Execute执行 <br><br>对foxpro 6.0采取odbc,建立一个数据源 <br>insert into t_d(申请日期,发票序号,序号,日期,发票号,发票种类,发货单id,申请单编号,片区,部门,销售员,客户代码,客户单位,开票名称,客户邮编,客户地址,客户电话,客户税号,客户开户行,客户帐号,开票单位,邮编,地址,电话,税号,开户行,帐号,编号,品名,规格,单位,单价,数量,金额,不含税单价,不含税金额,税额,底价,税率,税率1,红票金额,红票号,发票收件人,收件人地址,收件人电话,收件人邮编,备注,打印标志,制单,复核,审核,标志1,标志,管理模式,警示标志,结算单价,结算标准,扣率,冲减金额,回款金额,少回款,回款差额,欠款金额,欠款数量,来款单序号,主管部门,退票标志,退票日期,发货日期,申请号) <br>SELECT 申请日期,发票序号,序号,日期,发票号,发票种类,发货单id,申请单编号,片区,部门,销售员,客户代码,客户单位,开票名称,客户邮编,客户地址,客户电话,客户税号,客户开户 <br> <br>来自: 碧血剑, 时间: 2003-07-14 12:59:00, ID: 2027532 &nbsp;<br>to HUANGPEIYAN <br>贴的好,希望大家都能把自己的心得贴上。 <br>偶这星期结婚,比较忙,所以上来的时间就少了。 <br> <br>来自: jjchen123, 时间: 2003-07-15 8:22:00, ID: 2029165 &nbsp;<br>TO 碧血剑大虾 <br> &nbsp;祝你新婚快乐,记得以后多多上来,帮小弟解决解决问题. <br> <br>来自: huddle, 时间: 2003-07-15 10:41:00, ID: 2029730 &nbsp;<br>碧血剑兄,恭喜恭喜 <br> <br>来自: zyljruby, 时间: 2003-07-15 10:46:00, ID: 2029750 &nbsp;<br>楼主,抄来的就要拿出来说呀,呵呵, <br> <br>来自: fz97534, 时间: 2003-07-15 12:58:00, ID: 2030168 &nbsp;<br>AAAAAAAAAAAAAAAAAAAA <br>VVVVVVVVVVVVVVVVVVVVVV <br>WWWWWWWWWWWWWWWWWWWWWW <br>MMMMMMMMMMMMMMMMMMMMM <br>好 <br> <br>来自: delp, 时间: 2003-07-15 13:10:00, ID: 2030207 &nbsp;<br>可惜,我从来没用过BatchMove,不好说 <br> <br>来自: xxc, 时间: 2003-07-16 16:50:00, ID: 2034140 &nbsp;<br>各位大虾好:看到你们所说的导入导出功能(EXCEL 与 SQL SERVER)与SQL SERVER 的连接方式都是采用ODBC <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 难道非采用这种方式不行吗。这种连接方式局限性太大,如果采用adoconnection的 <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Microsoft OLE DB Provider for SQL Server 建立数据引擎,如: <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; adoconnection.connectionstring:='Provider=SQLOLEDB.1;Password=ps2000;Persist Security &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Info=True;User ID=sa;InitialCatalog=XSERP;Data Source=SERVER' <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 然后把该连接字符保存在文件中,在进行导入与导出时调用该连接符不是更好。为什么非要用ODBC呢? <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 还是用上种方式不行。如行的话该如何设置。最好有源码。谢谢! <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1.sql server导出到excel <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ADOConnection 指向excel, 用Jet4.0 ,Extended properties设为Excel 8.0 <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SELECT * into table &nbsp;FROM Tab1 //下行如何设置。(不用ODBC) <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IN [ODBC] [ODBC;Driver=SQL Server;UID=sa;PWD=;Server=127.0.0.1;DataBase=Demo;] <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 该操作我在用ODBC 能实现。 <br><br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2.excel导出到 sql server <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ADOConnection 指向excel, 用Microsoft OLE DB Provider for SQL Server设为: <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Provider=SQLOLEDB.1;Password=ps2000;Persist Security &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Info=True;User ID=sa;InitialCatalog=XSERP;Data Source=SERVER <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //--以下如何设置(不用ODBC) <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SELECT * into table &nbsp;FROM Tab1 IN [ODBC] <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [ODBC;Driver=SQL Server;UID=sa;PWD=;Server=127.0.0.1;DataBase=Demo;] <br><br> &nbsp; &nbsp; &nbsp;我的E-MAIL:xxc99@163.net <br> <br>来自: 99441dudu, 时间: 2003-07-16 21:05:00, ID: 2034814 &nbsp;<br>总节一下: <br>===============sql to sql=============== <br>1 : 添加adoconnect_AT 控件, 连接到目的数据库ntserver-it-----即被倒入的数据库 <br>2 :ADoconnect_AT.Execute('select * INTO goodsdu FROM ' <br>+'OPENDATASOURCE(''SQLOLEDB'',''Data Source=ntserver;User ID=sa;Password=99441dudu'').table_dudu.dbo.goods'); <br>showmessage('已经从ntserver 倒内容 ntserver-it 的 &nbsp;goodsdu ,即在ntserver-it 上 备份了 goods表 '); <br> //insert 用发跟上面一样,聪明的人该知道有什么用了把 <br>3 :其他的如此类推 <br>============access to access ========== <br>1 : 添加adoconnect_AT_acc 控件, 连接到目的数据库DU_acc.mdb-----即被倒入的数据库 <br>2 :self.ADO4.Execute('select * into aaa from goods in ''C:/DU_acc2.mdb'''); <br>showmessage('ok access to access '); <br>=========想看其它的===== <br>1.打开数据哭sql2000 索引输入 &nbsp;OPENDATASOURCE <br>2.其它的你也来试一下,期待你的精彩代码 <br>3.本人笨只有这么多了----2003-7-16 <br><br> <br>来自: supergq, 时间: 2003-07-17 14:27:00, ID: 2036991 &nbsp;<br> &nbsp;我也学到不少东西啊!!!!!1 <br> <br>来自: microding, 时间: 2003-07-17 22:05:00, ID: 2038240 &nbsp;<br>从Excel导数据到SQL2000中的出错: <br>SELECT * FROM OpenDataSource('Microsoft.Jet.OLEDB.4.0','Data Source=&quot;C:/INVB/b.xls&quot;;Extended Properties=&quot;Excel 5.0;HDR=Yes;&quot;;Persist Security Info=False')...sheet1$ <br>==== <br>在SQL-Query中执行出错误信息如下: <br>服务器: 消息 7399,级别 16,状态 1,行 1 <br>OLE DB 提供程序 'Microsoft.Jet.OLEDB.4.0' 报错。提供程序未给出有关错误的任何信息。 <br>OLE DB 错误跟踪[OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0' IDBInitialize::Initialize returned 0x80004005: &nbsp;提供程序未给出有关错误的任何信息。]。 <br><br> <br>来自: thlt, 时间: 2003-07-18 8:33:00, ID: 2038578 &nbsp;<br>看到您的帖子后觉得受益非浅,但是我用的是本地数据库,也就是说,要将本地的*.xls转换为*.db(Paradox类型),用您的办法能成吗?若能,请再发个帖子,并到这里领分: <br>http://www.delphibbs.com/delphibbs/dispq.asp?lid=1995681 (我的问题也在这里) <br><br> <br>来自: tonyjm202, 时间: 2003-07-18 8:51:00, ID: 2038644 &nbsp;<br>路过,确实有收获. <br> <br>来自: xp2000, 时间: 2003-07-18 9:07:00, ID: 2038700 &nbsp;<br>谢谢分享! <br> <br>来自: 99441dudu, 时间: 2003-07-20 21:22:00, ID: 2044805 &nbsp;<br>!!!! 这个如何解决哦! <br>http://www.delphibbs.com/delphibbs/dispq.asp?lid=2041303 <br> <br>来自: 山猫, 时间: 2003-07-21 1:09:00, ID: 2045147 &nbsp;<br> &nbsp;涓囧垎鎰熻阿 . <br> <br>来自: playboy2002, 时间: 2003-07-21 9:01:00, ID: 2045353 &nbsp;<br>我的问题也是excel 导入到sql server,解决不了,谁能解决请到以下帖子去领分! <br>http://www.delphibbs.com/delphibbs/dispq.asp?lid=2018026 <br><br> <br>来自: iwantflywithwinder, 时间: 2003-07-21 9:27:00, ID: 2045467 &nbsp;<br>playboy2002,这个我做过,你注意检查一下你的excel文件左下脚,有sheet1,sheet2的tab页面指示,你的表名对吗? <br> <br>来自: playboy2002, 时间: 2003-07-23 10:33:00, ID: 2051600 &nbsp;<br>我的错误跟楼上 [gold]microding, [/gold]一个样子,我不知道是什么原因!你们把excel导入到sql 2000的时候,excel要不要设置odbc?我的sql20000里面没有任何表,select * into ,应该可以创建数据表,郁闷ing! <br> <br>来自: playboy2002, 时间: 2003-07-23 10:36:00, ID: 2051618 &nbsp;<br>iwantflywithwinder, 这位仁兄,你能不能把你的运行环境详细说明。是不是对excel的数据表内容有要求?谢谢了!!!!! <br> <br>来自: 99441dudu, 时间: 2003-07-23 20:30:00, ID: 2054085 &nbsp;<br>to :碧血剑 txt导入SQLServer完整代码如何写! <br>sql : &nbsp;ADOconnect1 user id= sa password='' <br>txt : &nbsp;c:/temp/aa.txt <br>--------------------------------------- <br><br><br> <br>来自: ljh0311, 时间: 2003-07-24 9:58:00, ID: 2055043 &nbsp;<br>insert into Area_codeTable <br>select * from OpenRowset('MSDASQL', 'Driver={Microsoft Text Driver (*.txt; *.csv)}; <br>DefaultDir=c:/temp;','select * from li.txt') <br>///出现错误;; <br>仅当使用了列的列表,并且 IDENTITY_INSERT 为 ON 时,才能在表 'Area_codeTable' 中为标识列指定显式值。 <br>经查为'Area_codeTable'表中有一字段IDH为标识种子,把标识种子去掉,上面那条语句正常执行,如在IDH为种子时如何解决? <br><br> <br>来自: mahuan, 时间: 2003-07-24 15:01:00, ID: 2056228 &nbsp;<br>很好啊,我顶,顶,顶..... <br> <br>来自: iaboy, 时间: 2003-07-24 17:18:00, ID: 2056899 &nbsp;<br>sql-&gt;&gt;excel &nbsp; 用ado连  excel-&gt;&gt;sql ado连   access-&gt;&gt;sql ado连 <br>sql-&gt;&gt;access 用ado连 &nbsp; &nbsp;excel-&gt;&gt;access ado连  access-&gt;&gt;excel ado连 <br>sql-&gt;&gt;text &nbsp; &nbsp;用ado连 &nbsp; &nbsp;excel-&gt;&gt;text ado连  access-&gt;&gt;文本文件 ado连 <br>text-&gt;&gt;sql &nbsp; 用ado <br>text-&gt;&gt;access 用ado <br>text-&gt;&gt;text &nbsp; 用ado 实现数据记录对导。 <br>大家帮帮!能回答出的的到  <br>http://www.delphibbs.com/delphibbs/dispq.asp?lid=2054210 <br>拿分,请高手赐教!小弟都快被整傻了!         <br>    <br>   <br> <br>来自: 山猫, 时间: 2003-07-28 1:07:00, ID: 2063818 &nbsp;<br> 发现 &nbsp;这样的好 贴 , 不回对不起楼主. <br><br>感谢 楼主. <br><br> &nbsp; 这才是真正的 程序 员. <br><br>1. 有刻苦 钻研 并解决 &nbsp;问题的 能力. <br><br>2. 有 把自己 成果 公开 , 共享 和 努力 &nbsp;帮助大家的 热 心. <br><br> &nbsp; 真正可以 当 大侠. <br><br> &nbsp; &nbsp;功夫高并有 侠义心肠. &nbsp; <br><br> 不象有 点 &nbsp;烂 人. 在网上收集一些 资料 . 刻成盘还要 买 钱. &nbsp; <br><br>资料又不是 他自己 想出来的, 他也好 意思要 钱. <br><br> 和碧血剑 比起来. &nbsp;那些 人........ <br> <br>来自: lwowo, 时间: 2003-07-28 9:22:00, ID: 2064159 &nbsp;<br>好贴。 <br> <br>来自: Pc 狂迷, 时间: 2003-07-28 17:19:00, ID: 2066095 &nbsp;<br>碧血剑前辈: <br> &nbsp; 我在客户端执行(C与S不在同一台机上): <br> &nbsp; Select * &nbsp;from OpenRowset('MSDASQL', 'Driver={Microsoft Text Driver <br>(*.txt; *.csv)}; &nbsp;DefaultDir=F:/;','select * from AA.txt') <br> &nbsp;会出错: <br>{ <br>服务器: 消息 7399,级别 16,状态 1,行 1 <br>OLE DB 提供程序 'MSDASQL' 报错。 <br>[OLE/DB provider returned message: [Microsoft][ODBC Text &nbsp;驱动程序] '(未知的)'不是一个有效的路径。 确定路径名称拼写是否正确,以及是否连接到文件存放的服务器。] <br>} <br>如果 &nbsp;A。TXT 在S机上是没问题的,有办法解决这个问题吗? <br><br> <br>来自: chen_cch, 时间: 2003-07-29 9:33:00, ID: 2067075 &nbsp;<br>这么经典的东东,一定要顶。虽然我还没有试。 <br> <br>来自: liao_hc, 时间: 2003-07-30 17:22:00, ID: 2071598 &nbsp;<br>用adoconnection1连接sql server <br>adocommand1中的commandtext为以下字符串: <br>SELECT * into bbb <br>FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', <br>'Data Source=&quot;f:/dbf&quot;;User ID=;Password=;Extended properties=dBase 5.0')...chaobiao <br>其中(chaobiao.dbf为f:/dbf下的文件) <br>运行后提示以下错误: <br> '[blue]不正常地定义参数对象.提供了不一致或者不完整的信息[/blue].' <br>在sql server中的查询分析器运行上述sql语句无异常!! <br>请问大虾们why???????????????? <br><br> &nbsp;<br> <br>来自: iwillgo2, 时间: 2003-07-30 17:23:00, ID: 2071605 &nbsp;<br>除了感激还是感激,好贴。 <br> <br>来自: Pc 狂迷, 时间: 2003-07-30 18:01:00, ID: 2071745 &nbsp;<br>to liao_hc: <br><br>// 其中(chaobiao.dbf为f:/dbf下的文件) <br> f:/dbf 是在 SQL SERVER 服务器的硬盘上吗?如果不在是不行的! <br><br> <br>来自: lovewzm, 时间: 2003-07-30 18:04:00, ID: 2071760 &nbsp;<br>偶像! <br> <br>来自: gohigh, 时间: 2003-07-30 18:11:00, ID: 2071787 &nbsp;<br>鍋朵繚瀛樹簡璇ラ〉锛?03k澶у皬鍟婏紒:D <br><br> <br>来自: liao_hc, 时间: 2003-07-30 20:29:00, ID: 2072068 &nbsp;<br>to Pc 狂迷: <br> 是在服务器的硬盘上,可是怎么也不行呀。sql语句好象没错,在查询分析器能成功执行! 这种转换能在程序里实现吗? <br> 有谁在程序中用ado方式转换过: dbf---&gt;sql server???????? <br> <br>来自: sunlandbell, 时间: 2003-08-03 9:33:00, ID: 2080206 &nbsp;<br>麻烦大家看一下: <br>我用的是c/s系统,现在access库在本地库上,需要将本地库中的表更新到服务器的sql数据库中。因此adoconnection需连接access数据库。 <br>adoconnection执行所用语句为: <br>update t set 密码=职工.密码 from 职工,OPENDATASOURCE &nbsp; ('SQLOLEDB','Data Source=systemdata;User ID=sa;Password=112').分公司.dbo.职工 t where &nbsp;t.职工编号=职工.职工编号 <br><br>报错为:语法错误(操作符丢失)在查询表达式'职工.密码 from 职工'中。 <br>但此查询在sql查询分析器下在sql不同数据库中试验成功。 <br><br> <br>来自: flywing, 时间: 2003-08-04 10:33:00, ID: 2081879 &nbsp;<br>to 碧血剑: <br>我有一个SQL SERVER表大概有300多个字段, <br>现需导出成DBF,可我用ADOconnection连接至DBase 5.0 , <br>导出时提示“字段不能加入记录”,将字段减少为100左右即可, <br>而我用FOXPRO 5.0也不行, <br>请问用什么数据库驱动可以支持? <br> <br>来自: tonyjm202, 时间: 2003-08-11 23:18:00, ID: 2101724 &nbsp;<br>致各位仁兄: <br>======== <br>提问之前 <br>======== <br><br>在通过电邮、新闻组或者聊天室提出技术问题前,检查你有没有做到: <br>1. 通读手册,试着自己找答案。 <br>2. 在FAQ里找答案(一份维护得好的FAQ可以包罗万象:)。 <br>3. 在网上搜索(个人推荐google~~~)。 <br>4. 向你身边精于此道的朋友打听。 <br> <br>来自: wind2000, 时间: 2003-08-13 21:41:00, ID: 2103519 &nbsp;<br>今天又试了一下,已经完成了如下测试: <br>Access-&gt;TXT <br>Access-&gt;DBF <br>Access-&gt;Excel <br>Access-&gt;Access <br>TXT-&gt;Access <br>DBF-&gt;Access <br>Excel-&gt;Access <br><br>Oracle-&gt;TXT(测试没通过) <br>Oracle-&gt;DBF <br>Oracle-&gt;Access <br>Oracle-&gt;Excel <br>TXT-&gt;Oracle(还没测试) <br>DBF-&gt;Oracle <br>Access-&gt;Oracle <br>Excel-&gt;Oracle <br><br>因我不用SQL Server和其它数据库,所以没法测试,相信应该也是可以的! <br><br>Oracle-&gt;TXT的联接串和上面所说的一个样,如下,可是总会报无法找到文件(文件路径不对), <br>Microsoft.Jet.OLEDB.4.0认为联接的是个Access数据库,可是Data Source中写的却是个路径, <br>哪位有使用Oracle的帮忙测测! <br><br>//Oracle-&gt;TXT <br>//Provider=Microsoft.Jet.OLEDB.4.0;Data Source=f:/;Extended Properties=&quot;text;HDR=YES;FMT=Delimited&quot;;Persist Security Info=False <br>procedure TForm1.Button7Click(Sender: TObject); <br>var <br> sSql: String; <br>begin <br> sSql := 'select * into aaa.txt from lsygb in [ODBC][ODBC;Driver={Microsoft ODBC for Oracle};UID=bkls;PWD=bkls;SERVER=bkls;]'; <br> with TxtConnection do <br> &nbsp; begin <br> &nbsp; &nbsp; Close; <br> &nbsp; &nbsp; Connected := True; <br> &nbsp; &nbsp; Execute(sSql); <br> &nbsp; end; <br>end; <br> <br>来自: Worm, 时间: 2003-08-14 12:55:00, ID: 2107585 &nbsp;<br>各位大富翁,你们好! <br> &nbsp;<br>_______________________form_______________________________ <br>_ <br>来自:wind2000, 时间:2003-8-13 21:41:00, ID:2103519 <br>今天又试了一下,已经完成了如下测试: <br>Access-&gt;TXT <br>Access-&gt;DBF <br>Access-&gt;Excel <br>Access-&gt;Access <br>TXT-&gt;Access <br>DBF-&gt;Access <br>Excel-&gt;Access <br><br>Oracle-&gt;TXT(测试没通过) <br>Oracle-&gt;DBF <br>Oracle-&gt;Access <br>Oracle-&gt;Excel <br>TXT-&gt;Oracle(还没测试) <br>DBF-&gt;Oracle <br>Access-&gt;Oracle <br>Excel-&gt;Oracle <br><br>因我不用SQL Server和其它数据库,所以没法测试,相信应该也是可以的! <br><br>Oracle-&gt;TXT的联接串和上面所说的一个样,如下,可是总会报无法找到文件(文 <br>件路径不对), <br>Microsoft.Jet.OLEDB.4.0认为联接的是个Access数据库,可是Data Source中写 <br>的却 <br>是个路径, <br>哪位有使用Oracle的帮忙测测! <br><br>//Oracle-&gt;TXT <br>//Provider=Microsoft.Jet.OLEDB.4.0;Data Source=f:/;Extended <br>Properties=&quot;text;HDR=YES;FMT=Delimited&quot;;Persist Security Info=False <br>procedure TForm1.Button7Click(Sender: TObject); <br>var <br>sSql: String; <br>begin <br>sSql := 'select * into aaa.txt from lsygb in [ODBC][ODBC;Driver= <br>{Microsoft ODBC <br>for Oracle};UID=bkls;PWD=bkls;SERVER=bkls;]'; <br>with TxtConnection do <br> &nbsp;begin <br> &nbsp; &nbsp;Close; <br> &nbsp; &nbsp;Connected := True; <br> &nbsp; &nbsp;Execute(sSql); <br> &nbsp;end; <br>end; &nbsp; <br><br><br>______________________end &nbsp; <br>________________________________ <br><br>------------------------------请教内容------------------------------------------------- <br>我有一程序也需要导出功能,如下: <br>unit Unit1; <br><br>interface <br><br>uses <br> Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, <br>Forms, <br> Dialogs, StdCtrls, Buttons, DB, ADODB, Grids, DBGridEh,DBGridEhImpExp; <br><br>type <br> TForm1 = class(TForm) <br> &nbsp; ADOTable1: TADOTable; <br> &nbsp; DBGridEh1: TDBGridEh; <br> &nbsp; DataSource1: TDataSource; <br> &nbsp; ADOConnection1: TADOConnection; <br> &nbsp; BitBtn1: TBitBtn; <br> &nbsp; SaveDialog1: TSaveDialog; <br> &nbsp; procedure BitBtn1Click(Sender: TObject); <br> private <br> &nbsp; { Private declarations } <br> public <br> &nbsp; { Public declarations } <br> end; <br><br>var <br> Form1: TForm1; <br><br>implementation <br><br>{$R *.dfm} <br><br>procedure TForm1.BitBtn1Click(Sender: TObject); <br>var <br> &nbsp; ExpClass:TDBGridEhExportClass; <br> &nbsp; Ext:String; <br>begin <br> SaveDialog1.FileName := 'file1'; <br>// &nbsp;if (ActiveControl is TDBGridEh) then <br> &nbsp; if SaveDialog1.Execute then <br> &nbsp; begin <br> &nbsp; &nbsp; case SaveDialog1.FilterIndex of <br> &nbsp; &nbsp; &nbsp; 1: begin ExpClass := TDBGridEhExportAsText; Ext := 'txt'; end; <br> &nbsp; &nbsp; &nbsp; 2: begin ExpClass := TDBGridEhExportAsXLS; Ext := 'xls'; end; <br> &nbsp; &nbsp; &nbsp; 3: begin ExpClass := TDBGridEhExportAsHTML; Ext := 'htm'; end; <br> &nbsp; &nbsp; else <br> &nbsp; &nbsp; &nbsp; ExpClass := nil; Ext := ''; <br> &nbsp; &nbsp; end; <br> &nbsp; &nbsp; if ExpClass &lt;&gt; nil then <br> &nbsp; &nbsp; begin <br> &nbsp; &nbsp; &nbsp; if UpperCase(Copy(SaveDialog1.FileName,Length <br>(SaveDialog1.FileName)-2,3)) &lt;&gt; UpperCase(Ext) then <br> &nbsp; &nbsp; &nbsp; &nbsp; SaveDialog1.FileName := SaveDialog1.FileName + '.' + Ext; <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if not FileExists(SaveDialog1.FileName) then <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SaveDBGridEhToExportFile <br>(ExpClass,DBGridEh1,SaveDialog1.FileName,True) <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;application.MessageBox('文件已经存在!','导出失 <br>败',MB_ICONERROR); <br> &nbsp; &nbsp; end; <br> &nbsp; end; <br>showmessage('导出以完成。但以上只可以导出三种数据类型,怎样才能使之 <br>导出成dbf和mdb呢?请指教!'); <br>end; <br>//一定要用ADO,最好还是在DBgridEH的基础上定,也就是我按钮上想实现在 <br>功能! <br>end. <br><br>//此事盛急,小弟以拖数日,查找了多方资料,定请指教! 小弟拜谢+DFW$300。 <br><br> 致 礼! <br><br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;The glow-worm <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;worm1997@msn.com <br> <br>来自: 谢方, 时间: 2003-08-16 14:24:00, ID: 2112940 &nbsp;<br>果然好. <br>但是请教: <br>两个数据源都是使用dbExpress技术,一个连接SQLServer服务器,一个连接本地InterBase,如何将SQLServer表格导入到InterBase中?(不通过ODBC),可以使用ClientDataSet <br> <br>来自: railgunman, 时间: 2003-08-22 16:58:00, ID: 2127831 &nbsp;<br>告诉你一个最快的方法,用SQLServer连接DBF <br>在SQLServer中执行 <br>SELECT * into bmk <br>FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', <br>'Data Source=&quot;e:/share&quot;;User ID=Admin;Password=;Extended properties=dBase 5.0')...bmk <br>-------------------------------------------------------------------------- <br>上面的那句SQL语句确实可以解决一些dbf数据库,但是却打不开VFP的数据库!如果要打开VFP的DBF表的话,那该怎么办呢?????????????? <br> <br>来自: frogshero, 时间: 2003-08-29 10:31:00, ID: 2141843 &nbsp;<br>經典﹐強貼﹐寶庫 <br> <br>来自: yangyong_net, 时间: 2003-09-01 10:21:00, ID: 2147503 &nbsp;<br> &nbsp; 请教老兄一个问题,就是通过ADO将DBF数据转换为文本,但我试了好多次都不成功,希望老兄能够帮忙看看; <br><br>1.用ADO连接文本,连接串正确,连接成功:然后操作 <br>ADOConnTXT.Execute('SELECT * INTO [Text;Database=D:/TEMP].DBF.TXT FROM [DBase 5.0;Data Source=C:/Program Files/Common Files/Borland Shared/Data].clients'); <br>2.用ADO连接DBF,连接串正确,连接成功:然后操作 <br>ADOConnDBF.Execute('SELECT * INTO [Text;Database=D:/TEMP].DBF.TXT FROM clients'); <br><br>两种方法都不成功,不清楚什么原因。请老兄帮忙解决一下,救急! <br><br> <br>来自: yocheng, 时间: 2003-09-01 10:32:00, ID: 2147554 &nbsp;<br>兩個字 &nbsp;弓+虽=强! <br> <br>来自: JUMP1972, 时间: 2003-09-01 16:00:00, ID: 2148573 &nbsp;<br>好象只能用在数据库服务器上(如果DBF与SQL不在同一台机器上,就会失败,怎么解决呢?) <br> <br>来自: zwk6608, 时间: 2003-09-10 13:00:00, ID: 2169359 &nbsp;<br>谢谢楼主!!! <br>我用这一方法实现了将SQL SERVER 数据库导出为本地的EXCEL 文件 <br>或 DBF 文件。数据库服务器不在同一台机器上也可实现。 <br> <br>来自: sunrainwang, 时间: 2003-09-12 12:53:00, ID: 2174034 &nbsp;<br>首先我的目的是顶一下好贴,让尽可能多的DFW得益。 <br>然后请教各位富翁: <br>前面所指均是完成在C/S结构下的数据导入导出功能,而且大家都讨论的很详细。但是小弟我现在要求完成在多层结构中客户端的数据导出怎么办? <br>详情请见此帖: <br>http://www.delphibbs.com/delphibbs/dispq.asp?lid=2172336 <br> <br>来自: zwk6608, 时间: 2003-09-15 14:35:00, ID: 2175659 &nbsp;<br>请问楼主,如果我想从SYBASE 数据库中将表导入SQL SERVER , <br>语句如下, <br>SELECT * into aaa FROM <br> &nbsp;OPENDATASOURCE('SQLOLEDB', <br>'DRIVER={Sybase System 11};Server=svr;UID=sa; <br>PWD=sa;Database=db').db.dbo.table_name <br>但不能执行,报错为“连接字符串属性无效” <br>请问SYBASE 连接字符串如何写? <br> <br>来自: _delphi, 时间: 2003-09-15 14:46:00, ID: 2178401 &nbsp;<br>厉害 <br>佩服 <br> <br>来自: muyexin, 时间: 2003-09-17 14:57:00, ID: 2182936 &nbsp;<br>各位高手,我现在遇到了难题。请帮我看看吧!好心的~ <br><br>1.我想导出 DBgrid 中的记录,即Adoquery1的结果集,而不是数据表的全部; <br>2.在导入时我想如果有键值相同的记录,想覆盖或跳过(不覆盖),能做到么,怎么写代码? <br>3.我想选择路径,让操作者自己选择保存路径,不是固定如C:/temp/aaaa.txt; <br>4.楼上有朋友提到,ACCESS--TXT 时,'select * into [text;Database=c:/].aaaa.txt from TABLENAME',如果 aaaa.txt 已经存在,则会报错,各位是如何解决的? <br><br>请各位在百忙中花少少时间,给我一点思路吧!不胜感激! <br> <br>来自: muyexin, 时间: 2003-09-17 15:38:00, ID: 2183052 &nbsp;<br>焦急中~ <br> <br>来自: phyyun, 时间: 2003-09-19 11:38:00, ID: 2187042 &nbsp;<br>to muyexin <br>1,2、自己写程序导到另外一个表里啊。如果有键值重复(你原来那个表没控制?)的情况,那先判断过滤一下,自己写程序,得到没重复的所有记录。 <br>3,那你可以让用户输入保存路径,再导啊,都不是问题啊 <br> <br>来自: hlfdsj, 时间: 2003-09-19 11:44:00, ID: 2187059 &nbsp;<br>高手! <br> <br>来自: bales, 时间: 2003-09-24 10:04:00, ID: 2196279 &nbsp;<br>用delphi程序如何实现access 到sql库的转变呢?其中access 库包含的字段可分别划分成sql中的两个表。即某些字段导出成sql 的A表,某些字段导出成sql的B表。 <br> <br>来自: icet, 时间: 2003-09-24 18:01:00, ID: 2197732 &nbsp;<br>碧血剑老兄是不是不关注此问题了? <br><br>小弟有个问题,关键在第五、六栏,请大虾过去回答领分,分数可以再加,先感谢了: <br>http://www.delphibbs.com/delphibbs/dispq.asp?lid=2186012 <br><br><br><br> <br>来自: vvvguo, 时间: 2003-09-26 12:44:00, ID: 2201517 &nbsp;<br>to wind2000 <br>请教如何从access导到oracle用这个方法? <br> <br>来自: eelancy, 时间: 2003-10-03 17:28:00, ID: 2212833 &nbsp;<br>我想在DELPHI中,把一个clientdataset的数据导出为excel,还可以用这种异构数据库的方法吗?clientdataset好象对应的引擎啊 <br> <br>来自: homejun, 时间: 2003-10-04 20:53:00, ID: 2214150 &nbsp;<br>to 碧血剑: <br>碧血剑兄你的第二种方法是从<Mastering Delphi7>里学来的吧,我也正看呢。 <br> <br>来自: yulinsoft, 时间: 2003-10-13 9:07:00, ID: 2226443 &nbsp;<br>hmzz: <br> &nbsp; 这个问题你解决了吗?我出现的错误和你的错误一样...不知道你有没有解决这个问题。请回答我... <br> &nbsp; 简单的告诉我为什么会出现这个错误,你是怎么修正的?谢谢 <br> <br>来自: yulinsoft, 时间: 2003-10-13 13:01:00, ID: 2227119 &nbsp;<br>SELECT * FROM <br>OpenDataSource('Microsoft.Jet.OLEDB.4.0','Data Source=&quot;C:/123.xls&quot;;Extended Properties=Excel 8.0;Persist Security Info=False')...Sheet1$ <br>报错: <br>Server: Msg 7314, Level 16, State 1, Line 1 <br>OLE DB provider 'Microsoft.Jet.OLEDB.4.0' does not contain table 'Sheet1$'. <br><br>请各位弄明白的大虾帮我看看 <br> <br>来自: eelancy, 时间: 2003-10-16 23:14:00, ID: 2235279 &nbsp;<br>写成[Sheet1$]试试 <br> <br>来自: gu5, 时间: 2003-10-18 22:03:00, ID: 2238844 &nbsp;<br>楼上的: <br>要把db改成mdb的又该怎么办(用Access导出时会乱码) <br> <br>来自: vvvguo, 时间: 2003-10-18 23:08:00, ID: 2238941 &nbsp;<br>access to oracle 一至没有成功, <br> <br>来自: eelancy, 时间: 2003-10-19 23:10:00, ID: 2240013 &nbsp;<br>如果我想从oracle导出到excel,而ADO连接oracle,怎么实现? <br>有没有人试过? <br>这是我的SQL语句: <br>CREATE TABLE tablename in &quot;D:/temp/test.xls&quot; &quot;Excel 8.0;&quot; AS SELECT * FROM AAA <br>其中,AAA是Oracle数据库中的表名。 <br>出错信息是“无值提供给一或多个必要参数”。 <br>有人知道这是什么原因吗? <br> <br>来自: jzpang1980, 时间: 2003-10-20 21:40:00, ID: 2242251 &nbsp;<br>当我执行从SQLSERVER导入EXCEL时,提示找不到可以安装的ISAM,请问是什么原因 <br><br>谢谢 <br> <br>来自: lyco, 时间: 2003-10-21 0:45:00, ID: 2242458 &nbsp;<br>我是不是太笨了,下面这个语句: <br>'INSERT INTO OpenDataSource(''Microsoft.Jet.OLEDB.4.0'',' <br> &nbsp; + '''Data Source=&quot;%s&quot;;Persist Security Info=False;Extended properties=;'')...%s(%s)' //参数:文件名称、表名、字段列表 <br> &nbsp; + ' SELECT %s FROM %s '; //参数:字段列表、表名 <br>在“SQL查询分析器”里面执行没有问题,可是在程序里面执行,就会报错: <br>“不正常的定义参数对象,提供了不一致或不完整的信息” <br>我的ADOconnection使用的是“SQLOLEDB.1”驱动, <br>这个错误是怎么回事呢? <br><br>哦,忘了说了,我是连到SQLServer里面然后试图把数据从SQLServer倒到Access文件里面,各位大侠,你们说这个语句究竟有什么问题呢?access文件的“Extended properties”究竟应该是什么呢? <br><br> <br>来自: jzpang1980, 时间: 2003-10-21 9:47:00, ID: 2242838 &nbsp;<br>当我执行从SQLSERVER导入EXCEL时,提示找不到可以安装的ISAM,请问是什么原因 <br><br>谢谢 &nbsp; <br> <br>来自: sars1, 时间: 2003-10-21 9:59:00, ID: 2242884 &nbsp;<br>这么老的帖子都出来了! <br> <br>来自: jzpang1980, 时间: 2003-10-21 14:11:00, ID: 2243651 &nbsp;<br>当我执行从SQLSERVER导入EXCEL时,提示找不到可以安装的ISAM,请问是什么原因 <br><br>谢谢 &nbsp; &nbsp; <br> <br>来自: vvvguo, 时间: 2003-10-23 8:04:00, ID: 2247194 &nbsp;<br>access to oracle 一至没有成功,那位成功了就给点指导,谢谢 <br> <br>来自: wind2000, 时间: 2003-10-23 16:21:00, ID: 2248585 &nbsp;<br>下面是我的一个程序中的部份代码,是有关Access-&gt;Oracle的! <br>//全局变量 <br>Const <br> sFilter3 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 'Access文件(*.mdb)|*.mdb'; <br> sExt3 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = '.mdb'; <br> ... <br> sFSep1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= '『'; <br> sFSep2 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= '』'; <br> sMsg23 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= '文件%s不存在,请输入(选择)一个已经存在的文件!'; <br>var <br> sUID, sPWD, sServer: string; <br>... <br>//Access-&gt;Oracle; <br>procedure TfrmExport.Access2Oracle; <br>var <br> i &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : integer; <br> sSql, sFN, sPath, sMsg, sCNTStr: string; <br> slTabs, slTmp &nbsp; &nbsp; : TStrings; <br>begin <br> with OpenDialog do <br> &nbsp; begin <br> &nbsp; &nbsp; Filter := sFilter3; &nbsp; <br> &nbsp; &nbsp; DefaultExt := sExt3; <br> &nbsp; &nbsp; if Execute then <br> &nbsp; &nbsp; &nbsp; begin <br> &nbsp; &nbsp; &nbsp; &nbsp; sFN := FileName; <br> &nbsp; &nbsp; &nbsp; &nbsp; sPath := ExtractFilePath(sFN); <br> &nbsp; &nbsp; &nbsp; &nbsp; sTab2 := ExtractFileName(sFN); <br> &nbsp; &nbsp; &nbsp; &nbsp; if not FileExists(sFN) then <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; begin <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sMsg := Format(sMsg23, [sFSep1 + sFN + sFSep2]); <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Application.MessageBox(PChar(sMsg), PChar(sWarning), <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MB_ICONINFORMATION + MB_OK); <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; palNote.Visible := False; &nbsp;//提示用的:TPanel类 <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; btnOk.Enabled := True; <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Exit; <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end; <br> &nbsp; &nbsp; &nbsp; end <br> &nbsp; &nbsp; else <br> &nbsp; &nbsp; &nbsp; begin <br> &nbsp; &nbsp; &nbsp; &nbsp; palNote.Visible := False; <br> &nbsp; &nbsp; &nbsp; &nbsp; btnOk.Enabled := True; <br> &nbsp; &nbsp; &nbsp; &nbsp; Exit; <br> &nbsp; &nbsp; &nbsp; end; <br> &nbsp; end; <br> sCNTStr := ADOConnection.ConnectionString; <br> slTmp := TStringList.Create; <br> CheckSite(sCNTStr, ';', slTmp); <br>{这里不用slTmp.DelimitedText是因为联接字符串中有空格,而空格会被认为是间隔符} <br> //用户名 <br> sUID := GetStr(slTmp, 'USER ID='); <br> //密码 <br> sPWD := GetStr(slTmp, 'PASSWORD='); <br> //服务名 <br> sServer := GetStr(slTmp, 'DATA SOURCE='); <br> slTmp.Free; <br> slTabs := TStringList.Create; <br> sCNTStr := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' + sFN <br> &nbsp; + ';Persist Security Info=True'; <br> with AConnection do <br> &nbsp; begin <br> &nbsp; &nbsp; Close; <br> &nbsp; &nbsp; ConnectionString := sCNTStr; <br> &nbsp; &nbsp; Connected := True; <br> &nbsp; &nbsp; GetTableNames(slTabs, False); <br> &nbsp; end; <br>//=====下面这段代码是选择数据库中的表===== <br> bAll := True; <br> frmChooseField := TfrmChooseField.Create(Application); <br> with frmChooseField do <br> &nbsp; begin <br> &nbsp; &nbsp; ListBoxAllField.Items.Assign(slTabs); <br> &nbsp; &nbsp; ShowModal; <br> &nbsp; &nbsp; Release; <br> &nbsp; end; <br>//=====上面这段代码是选择数据库中的表===== <br> if not bExport then &nbsp; //选择表时按了[取消]按钮/不导 <br> &nbsp; begin <br> &nbsp; &nbsp; palNote.Visible := False; <br> &nbsp; &nbsp; btnOk.Enabled := True; <br> &nbsp; &nbsp; Exit; <br> &nbsp; end; <br> //整理选择的表名,存到slTabs中 <br> if Trim(sFields) &lt;&gt; '' then <br> &nbsp; CheckSite(sFields, ',', slTabs) <br> else <br> &nbsp; begin <br> &nbsp; &nbsp; palNote.Visible := False; <br> &nbsp; &nbsp; btnOk.Enabled := True; <br> &nbsp; &nbsp; Exit; <br> &nbsp; end; <br> //开始循环导数据 <br> for i := 0 to slTabs.Count - 1 do <br> &nbsp; begin <br> &nbsp; &nbsp; Application.ProcessMessages; <br> &nbsp; &nbsp; sTab2 := slTabs; <br> &nbsp; &nbsp; sTab1 := UpperCase(sTab2); <br> &nbsp; &nbsp; StatusBar.Panels[0].Text := sTab2; <br> &nbsp; &nbsp; sSql := 'select * into ' + sTab1 <br> &nbsp; &nbsp; &nbsp; + ' in [ODBC][ODBC;Driver={Microsoft ODBC for Oracle};UID=' + sUID <br> &nbsp; &nbsp; &nbsp; + ';PWD=' + sPWD + ';Server=' + sServer + ';] from ' + sTab2; <br> &nbsp; &nbsp; AConnection.Execute(sSql); <br> &nbsp; end; <br> slTabs.Free; <br>end; <br><br>function TfrmExport.CheckSite(const Str, Ch: string; var Mystring: TStrings) <br> : boolean; <br>{字符串Str以Ch分隔成几段小字符串,该函数是将这些小字符串提取出来并保存在MyString中 <br>Str:字符串 <br>Ch:分隔符 <br>Mystring:保存分隔后的字符串 <br>返回:分隔后的字符串数大于1则返回True,否则为False} <br>var <br> sit, n &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: integer; <br> S &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : string; <br>begin <br> Result := True; <br> MyString.Clear; <br> S := Str; <br> n := Length(Ch); <br> while True do <br> &nbsp; begin <br> &nbsp; &nbsp; if Pos(Ch, S) = 0 then <br> &nbsp; &nbsp; &nbsp; begin <br> &nbsp; &nbsp; &nbsp; &nbsp; MyString.Add(S); <br> &nbsp; &nbsp; &nbsp; &nbsp; Break; <br> &nbsp; &nbsp; &nbsp; end; <br> &nbsp; &nbsp; sit := Pos(Ch, S); <br> &nbsp; &nbsp; MyString.Add(Copy(S, 1, sit - 1)); <br> &nbsp; &nbsp; S := Trim(Copy(S, sit + n, Length(S))); <br> &nbsp; end; <br> if MyString.Count &lt; 2 then Result := False; <br>end; <br><br>function TfrmExport.GetStr(slTmp: TStrings; sStr: string): string; <br>var <br> i &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : integer; <br> sTmp &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: string; <br>begin <br> Result := ''; <br> for i := 0 to slTmp.Count - 1 do <br> &nbsp; begin <br> &nbsp; &nbsp; sTmp := UpperCase(slTmp); <br> &nbsp; &nbsp; if Pos(UpperCase(sStr), sTmp) &gt; 0 then <br> &nbsp; &nbsp; &nbsp; begin <br> &nbsp; &nbsp; &nbsp; &nbsp; sTmp := StringReplace(sTmp, UpperCase(sStr), '', [rfReplaceAll]); <br> &nbsp; &nbsp; &nbsp; &nbsp; Result := sTmp; <br> &nbsp; &nbsp; &nbsp; &nbsp; Break; <br> &nbsp; &nbsp; &nbsp; end; <br> &nbsp; end; <br>end; <br> <br>来自: zrz0320, 时间: 2003-10-25 16:20:00, ID: 2252315 &nbsp;<br>本人还有以下问题还未解决 <br>请各位大侠帮忙 <br>access&gt;&gt;excel <br>access&gt;&gt;sql <br>excel&gt;&gt;txt <br>这几个要怎样连啊 <br>代码看看 <br> <br>来自: xiami01, 时间: 2003-10-25 16:30:00, ID: 2252332 &nbsp;<br>我没有灌水啊,不让我UP <br> <br>来自: vvvguo, 时间: 2003-10-25 19:55:00, ID: 2252604 &nbsp;<br>谢谢,wind2000! <br> <br>来自: ghyghost, 时间: 2003-10-25 21:05:00, ID: 2252706 &nbsp;<br>非常有实用价值的代码 <br> <br>来自: ndust, 时间: 2003-10-25 22:30:00, ID: 2252812 &nbsp;<br>还有一个比较关键的 <br>sqlserver-&gt;oracle <br>oracle-&gt;sqlserver <br>如何解决 <br> <br>来自: vvvguo, 时间: 2003-10-26 9:50:00, ID: 2253071 &nbsp;<br>wind2000,很是遗憾,程序没有通过,告诉我ODBC--调用失败怎么回事阿 <br> <br>来自: LongHai, 时间: 2003-10-26 10:28:00, ID: 2253103 &nbsp;<br>很棒!帅呆了![h4][green]酷逼乐 <br> <br>来自: zrz0320, 时间: 2003-10-26 11:20:00, ID: 2253122 &nbsp;<br>今天又解决了一个 <br>本人还有以下问题还未解决 <br>请各位大侠帮忙 <br>access&gt;&gt;excel <br>excel&gt;&gt;txt <br>这几个要怎样连啊 <br><br> <br>来自: roman_pan, 时间: 2003-10-27 15:54:00, ID: 2255061 &nbsp;<br>我已经试过了,在SQL2000下试运行,可以的 <br> <br>来自: yulinsoft, 时间: 2003-10-27 16:56:00, ID: 2255278 &nbsp;<br>各位还在关注此问题的朋友,这个问题我目前一直没有解决。希望已经解决了的朋友能不能给我留个信箱或者QQ... 我目前的数据库是SQL Server 7.0 我在数据查询器里面查看目标数据库Excel,老是报错!希望能够得到大家的帮忙。 <br> &nbsp; 也许只需要点拨一下,一分钟。但我却因此受用一生...哈哈...多谢[^]! &nbsp;我的信箱:yulinsoft@163.com &nbsp; ymq5583@sina.com.cn &nbsp;yangminqing@hobiotech.com &nbsp; yangminqing@hob-cn.com <br> <br>来自: wchal, 时间: 2003-10-27 19:35:00, ID: 2255685 &nbsp;<br>sql轉換excel的問題: <br>所有number的字段内容都变成 &nbsp;'4545454 <br>的形式,我们看见的只有 &nbsp;4545454 是左对齐文本格式. <br>我要怎样才能计算存储格啊. &nbsp; <br><br><br> <br>来自: icet, 时间: 2003-10-27 20:20:00, ID: 2255762 &nbsp;<br>这是个好贴。 <br>速度确实非常快。 <br>但我用的时候觉得不爽的地方有几个: <br> 一、 目标表与原始EXCEL表类型的不匹配问题。类似手机号、时间等经常会出错。 <br> 二、 如果EXCEL表没有表头,或者说不是规范的“表格式”的EXCEL表,经常也 <br>会出错。 <br>所以,尽可能的时候偶用这个东东,但没有办法的时候还得用老土的OLE。 <br> <br>来自: weifang, 时间: 2003-10-28 14:24:00, ID: 2257396 &nbsp;<br>excel導入sql server怎麼做呢? <br> <br>来自: corraly, 时间: 2003-10-29 8:24:00, ID: 2258784 &nbsp;<br>To:碧血剑,我是一个数据库初学者,我按照你的方法在C++ Builder中进行实践(两种都试过了),发现根本不能通过调试,望赐教! <br> <br>来自: ndust, 时间: 2003-10-29 8:44:00, ID: 2258855 &nbsp;<br>我基本上都试通过了,就是一个问题,oledb 的各个数据库数据源简称是什么? <br>比如office:'Microsoft.Jet.OLEDB.4.0' <br>sqlserver:'sqldb' <br>oracle的是什么? <br>sybase的是什么? <br><br> <br>来自: vvvguo, 时间: 2003-10-29 12:13:00, ID: 2259515 &nbsp;<br>oracle:'MSDAORA' <br>兄弟,如果你access to oracle的程序调通的话。给个例子,我的信箱是:binyanguo@yahoo.com.cn,我oracle TO ACCESS早就调通了,反过来怎么也不行 <br> <br>来自: vvvguo, 时间: 2003-10-29 13:02:00, ID: 2259661 &nbsp;<br>adoqury1 连接access, <br>odbc连接ORACLE <br><br>procedure TForm1.Button1Click(Sender: TObject); <br>var <br>ssql:string; <br>begin <br>ssql:='select * into patentinf in &quot;&quot; &quot;ODBC;uid=system;pwd=manager;DSN=patents&quot; from diamond1'; <br>adoquery1.active:=false; <br>adoquery1.SQL.Clear; <br>adoquery1.SQL.Add(ssql); <br>adoquery1.Prepared:=true; <br>adoquery1.ExecSQL; <br><br>end; <br><br>end. <br><br>运行后出现‘ODBC-调用失败’,请高手指点!!!!!!! <br> <br>来自: baifeng, 时间: 2003-10-29 13:37:00, ID: 2259786 &nbsp;<br>g z <br> <br>来自: ndust, 时间: 2003-10-29 14:00:00, ID: 2259847 &nbsp;<br>我在windows 2003的iis中用isapi调用sql7的数据写入excel好使,同样的在NT4下就不好使,告诉sqlserver连接失败,(sql7和nt4在同一台计算机上,windows 2003调有的sql7和NT4在同一台计算机上),谁能解释什么原因?odbc也升过级. <br>用的是 <br>select * into table from user in [ODBC] [ODBC;Driver=SQL Server;UID=user;PWD=user;Server=data;DataBase=user;] <br>单独写一个小程序在这两台计算机上全部正常. <br><br>可以加分. <br> <br>来自: micky168, 时间: 2003-10-29 15:56:00, ID: 2260154 &nbsp;<br>碧血剑兄:请问我SQL导出到*.txt 不行呀,帮忙 <br> <br>来自: 积步, 时间: 2003-11-02 15:14:00, ID: 2268045 &nbsp;<br>来自:dirk, 时间:2003-3-21 10:41:00, ID:1699670 <br>这种方法我四年前就发现了,不过那时还没用delphi,在Access中使用的,最近有个人问了 <br>类似的问题,我回答了,好像也没什么人关注嘛! <br><br>--------------------------------------------------- <br>確實在DFW離線數據庫中看到過, 但是很快忘了, <br>謝謝樓主, 否則永遠遺忘了 <br> <br>来自: blyb, 时间: 2003-11-02 17:38:00, ID: 2268228 &nbsp;<br>高手! <br> <br>来自: ndust, 时间: 2003-11-06 9:02:00, ID: 2275784 &nbsp;<br>1.用ado指向本地盘的xls文件: <br>Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:/a.xls;Extended Properties=EXCEL 8.0;Persist Security Info=False <br>2.接着在ado中执行 <br>select sqrq as 申请日期,dw1 as 申报单位,dw2 as 用料单位,wzbm as 物资编码,wzmc as 物资名称,xhgg as 规格型号,cazh as 材质,jldw as 计量单位,lsjg as 历史价格,spjg as 参考价格,bid_flag as 是否招标,class as 物资类别,sqjg as 申请单价,sqsl as 申请数量,je as 合计金额,dhqx as 到货期限,jh_name as 计划性质,yt_name as 用途,jhq as 计划期,xmh as 项目号,xmmc as 项目名称,cd_name as 产地,bz as 备注 into [sheet1] from table IN [odbc] [odbc;Driver=SQL Server;UID=user;PWD=user;Server=data;DataBase=test;] <br>如果单独写一个程序,这样执行通过,在d盘生成一个a.xls文件,内容是从数据库中提出的数据。 <br>但是改写为isapi的dll文件,显示odbc连接错误,不能连接到sql server data. <br>这是什么原因 &nbsp; <br>在windows2003 server下正常,在winnt4 ,windows 2000 server 下显示sql server连接不上的错误。 <br><br>大侠帮助. <br> <br>来自: sxhmc, 时间: 2003-11-10 10:20:00, ID: 2283440 &nbsp;<br>各位大侠,我在用这个方SQL导入到EXCEl时,用ADO1连接EXCEL文档,并且是使用JET4.0,已经将ado1.connected:=true;(ado1.connectionstring:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:/hmc.xls;Extended Properties=&quot;Excel 8.0;HDR=YES;IMEX=1&quot;;Persist Security Info=False'); <br>但在执行如下语句时出现'找不到可安装的ISAM.' <br>ado1.Execute('select * into sheet1 from &nbsp;m_base in [odbc] [odbc:Driver=SQL Server;UID=sa;PWD=;Server=.;DataBase=ACCOUNTzy;]'); <br>请各位帮我查看一下.谢谢 <br> <br>来自: ndust, 时间: 2003-11-12 14:29:00, ID: 2289067 &nbsp;<br>sxhmc你sqlserver的驱动没有安装吧 <br><br>我的问题随能够解决呀! <br>1.用ado指向本地盘的xls文件: <br>Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:/a.xls;Extended Properties=EXCEL 8.0;Persist Security Info=False <br>2.接着在ado中执行 <br>select sqrq as 申请日期,dw1 as 申报单位,dw2 as 用料单位,wzbm as 物资编码,wzmc as 物资名称,xhgg as 规格型号,cazh as 材质,jldw as 计量单位,lsjg as 历史价格,spjg as 参考价格,bid_flag as 是否招标,class as 物资类别,sqjg as 申请单价,sqsl as 申请数量,je as 合计金额,dhqx as 到货期限,jh_name as 计划性质,yt_name as 用途,jhq as 计划期,xmh as 项目号,xmmc as 项目名称,cd_name as 产地,bz as 备注 into [sheet1] from table IN [odbc] [odbc;Driver=SQL Server;UID=user;PWD=user;Server=data;DataBase=test;] <br>如果单独写一个程序,这样执行通过,在d盘生成一个a.xls文件,内容是从数据库中提出的数据。 <br>但是改写为isapi的dll文件,显示odbc连接错误,不能连接到sql server data. <br>这是什么原因 &nbsp; <br>在windows2003 server下正常,在winnt4 ,windows 2000 server 下显示sql server连接不上的错误。 <br><br>大侠帮助. &nbsp; <br><br><br> <br>来自: 暖人心间, 时间: 2003-11-13 9:05:00, ID: 2290607 &nbsp;<br>我也提一个问题吧,很重要啊 <br>从用adotable连接excel文件,在dbgrid中显示,成功!但发现建立adotable的字段实例时,原来excel中的供应商编号,发票号等等都变成float型的(这些大多是数字组成),问题是excel中的发票号一列中包含了“,”“/”“-”等字符,而且不可以去掉的,但在连接adotable中凡是有特殊字符的发票号全部丢失了,怎么办!! <br> <br>来自: 暖人心间, 时间: 2003-11-13 13:45:00, ID: 2291631 &nbsp;<br>lyco, <br> 你提到的问题,在sql查询器里都正常,而在delphi中出现“不正常的定义参数对象,提供了不一致或不完整的信息” <br> 我也遇到了,不过折腾了半天,我解决了 <br> 我将adoquery 的属性ParamCheck 设为 false 默认true, <br> 修改之后这个问题就不出现了,你试试! <br> <br>来自: salesource, 时间: 2004-03-29 4:48:05, ID: 2292224 &nbsp;<br>哦 是吗 <br> <br>来自: byteson, 时间: 2003-11-13 22:10:00, ID: 2292911 &nbsp;<br>关键就是从EXCELD转到ACCESS或SQLSERVER中时,不能控制字段数据类型,象是带数字和字母的都变成的float型,结果字母或符号都丢了,没法解决,和暖人心间碰到的问题一样 <br> <br>来自: 暖人心间, 时间: 2003-11-15 15:34:00, ID: 2296439 &nbsp;<br>如何用SQL查询直接读取其他数据源 <br>例: <br>USE ufdata_999_2001 <br>SELECT top 1 'ACCESS'as 数据库, [cSysID], [cID], [cName], [cCaption], [cType], [cValue], [cDefault], [bVisible], [bEnable] <br>FROM <br> &nbsp;OPENROWSET('Microsoft.Jet.OLEDB.4.0', <br> &nbsp;'c:/temp/fq.mdb';'admin';'', accinformation) &nbsp; &nbsp; <br>union all <br>SELECT top 1 'SQLOLEDB',a.[cSysID], [cID], [cName], [cCaption], [cType], [cValue], [cDefault], [bVisible], [bEnable] <br>FROM OPENROWSET('SQLOLEDB','(local)';'sa';'', <br> &nbsp;'select * from ufdata_999_2001..accinformation') AS a <br>union all <br>SELECT top 1 'MSSQL',[cSysID], [cID], [cName], [cCaption], [cType], [cValue], [cDefault], [bVisible], [bEnable] <br>from accinformation <br><br><br>OPENROWSET <br>包含访问 OLE DB 数据源中的远程数据所需的全部连接信息。当访问链接服务器中的表时,这种方法是一种替代方法,并且是一种使用 OLE DB 连接并访问远程数据的一次性的、特殊的方法。可以在查询的 FROM 子句中像引用表名那样引用 OPENROWSET 函数。依据 OLE DB 提供程序的能力,还可以将 OPENROWSET 函数引用为 INSERT、UPDATE 或 DELETE 语句的目标表。尽管查询可能返回多个结果集,然而 OPENROWSET 只返回第一个。 <br><br>语法 <br>OPENROWSET ( 'provider_name' <br> &nbsp; , { 'datasource' ; 'user_id' ; 'password' <br> &nbsp; &nbsp; &nbsp; | 'provider_string' } <br> &nbsp; , { [ catalog.] [ schema.] object <br> &nbsp; &nbsp; &nbsp; | 'query' } <br> &nbsp; ) <br><br>参数 <br>'provider_name' <br><br>字符串,它代表在注册表中指定的 OLE DB 提供程序的友好名。provider_name 没有默认值。 <br><br>'datasource' <br><br>字符串常量,它对应着某个特定的 OLE DB 数据源。datasource 是将被传递到提供程序 IDBProperties 接口以初始化提供程序的 DBPROP_INIT_DATASOURCE 属性。通常,这个字符串包含数据库文件的名称、数据库服务器的名称,或者提供程序能理解的用于查找数据库的名称。 <br><br>'user_id' <br><br>字符串常量,它是传递到指定 OLE DB 提供程序的用户名。user_id 为连接指定安全上下文,并将它作为 DBPROP_AUTH_USERID 属性传递进来以初始化提供程序。 <br><br>'password' <br><br>字符串常量,它是将被传递到 OLE DB 提供程序的用户密码。当初始化提供程序时,将 password 作为 DBPROP_AUTH_PASSWORD 属性传递进来。 <br><br>'provider_string' <br><br>提供程序特定的连接字符串,将它作为 DBPROP_INIT_PROVIDERSTRING 属性传递进来以初始化 OLE DB 提供程序。通常 provider_string 封装初始化提供程序所需的所有连接信息。 <br><br>catalog <br><br>目录或数据库的名称,其中驻留着指定的对象。 <br><br>schema <br><br>架构的名称或指定对象的对象所有者名称。 <br><br>object <br><br>对象名称,它唯一地标识出将要操作的对象。 <br><br>'query' <br><br>是字符串常量,发送到提供程序并由提供程序执行。 <br><br> <br>来自: wzhiwei, 时间: 2003-11-15 16:03:00, ID: 2296503 &nbsp;<br>关 注 <br> <br>来自: ilikemeng, 时间: 2003-11-20 16:40:00, ID: 2305667 &nbsp;<br>to wind2000 <br>Excel-&gt;Oracle <br>应该怎么做啊?谢谢!在线等待! <br> <br>来自: jingzi, 时间: 2003-11-25 17:36:00, ID: 2316507 &nbsp;<br>如何在远程服务器上实现?麻烦相告! <br>还有就是我是用vf6.0和sql互相导数据,语句应该怎么写? <br> <br>来自: chenshaizi, 时间: 2003-11-28 11:50:00, ID: 2320793 &nbsp;<br>异构数据库之间的导入导出示例 <br>异构数据库之间的导入导出示例,abc为表,包含以下导入与导出 <br>MSSQL2EXCEL EXCEL2MSSQL &nbsp;MSSQL2VFP VFP2MSSQL <br>MSSQL2access access2MSSQL &nbsp;excel2access access2excel <br>实现部分 <br>procedure TForm1.btn_MSSQL2EXCELClick(Sender: TObject); <br>begin <br>//MSSQL2EXCEL <br>ADOConnection1.ConnectionString:= <br>'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=G:/mysmallexe/excel2sql/yp.xls;' <br>+'Extended Properties=excel 8.0;Persist Security Info=False'; <br>ADOConnection1.Execute('select * into [Abc] from drug_yk IN [ODBC] [ODBC;Driver=SQL Server;UID=sa;PWD=kcsoft58;Server=127.0.0.1;DataBase=kcsoft_his]'); <br>//把一个MSSQL的数据库表及数据导出到excel中,abc为excel中不存在的表名,drug_yk为MSSQL里的表, sa为用户, &nbsp;kcsoft58为密码 , 127.0.0.1为服务大地址 ,kcsoft_his是数据库名称 <br>ADOConnection1.Execute('insert into [abc] select * from drug_yk in [ODBC] [ODBC;Driver=SQL Server;UID=sa;PWD=kcsoft58;Server=127.0.0.1;DataBase=kcsoft_his]'); <br>//把一个MSSQL的数据库表的记录增加到到excel中,执行以后相当于两倍量的数据,一次是导入,一次是insert <br>end; <br>procedure TForm1.btn_EXCEL2MSSQLClick(Sender: TObject); <br>begin <br>//EXCEL2MSSQL <br>ADOConnection1.ConnectionString:='Provider=SQLOLEDB.1;Password=KCSOFT58;Persist Security Info=True;User ID=SA;Initial Catalog=KCSOFT_HIS;Data Source=CHEN'; <br> ADOConnection1.Execute('SELECT * into [abc] FROM OpenDataSource( ' <br> +QuotedStr('Microsoft.Jet.OLEDB.4.0')+',' <br> +QuotedStr('Data Source=&quot;G:/mysmallexe/excel2sql/yp.xls&quot;;Extended Properties=excel 8.0;Persist Security Info=False')+')...[Abc]'); <br>end; <br>procedure TForm1.btn_MSSQL2VFPClick(Sender: TObject); <br>begin <br>//MSSQL2VFP <br>ADOConnection2.ConnectionString:= <br>'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=G:/mysmallexe/excel2sql;' <br>+'Extended Properties=dBase 5.0;Persist Security Info=False'; <br>ADOConnection2.Execute('select * into Abc.dbf from drug_yk IN [ODBC] [ODBC;Driver=SQL Server;UID=sa;PWD=kcsoft58;Server=127.0.0.1;DataBase=kcsoft_his]'); <br>//把一个MSSQL的数据库表及数据导出到VFP中,Abc.dbf 为VFP中不存在的表名,drug_yk为MSSQL里的表, sa为用户, &nbsp;kcsoft58为密码 , 127.0.0.1为服务大地址 ,kcsoft_his是数据库名称 <br><br>end; <br><br>procedure TForm1.btn_VFP2MSSQLClick(Sender: TObject); <br>begin <br>//VFP2MSSQL <br> ADOConnection2.ConnectionString:='Provider=SQLOLEDB.1;Password=KCSOFT58;Persist Security Info=True;User ID=SA;Initial Catalog=KCSOFT_HIS;Data Source=CHEN'; <br> ADOConnection2.Execute('SELECT * into [abc] FROM OpenDataSource( ' <br> +QuotedStr('Microsoft.Jet.OLEDB.4.0')+',' <br> +QuotedStr('Data Source=&quot;G:/mysmallexe/excel2sql&quot;;Extended Properties=dBase 5.0;Persist Security Info=False')+')...[Abc]'); <br>end; <br><br><br><br>procedure TForm1.btn_MSSQL2accessClick(Sender: TObject); <br>begin <br>//MSSQL2access <br> &nbsp; ADOConnection2.ConnectionString:= <br>'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=G:/mysmallexe/excel2sql/Server.MDB;' <br>+'Persist Security Info=False;Jet OLEDB:Database Password=happynewyear'; <br>ADOConnection2.Execute('select * into Abc from drug_yk IN [ODBC] [ODBC;Driver=SQL Server;UID=sa;PWD=kcsoft58;Server=127.0.0.1;DataBase=kcsoft_his]'); <br><br>end; <br><br>procedure TForm1.btn_access2MSSQLClick(Sender: TObject); <br>begin <br>//access2MSSQL <br>ADOConnection2.ConnectionString:='Provider=SQLOLEDB.1;Password=KCSOFT58;Persist Security Info=True;User ID=SA;Initial Catalog=KCSOFT_HIS;Data Source=CHEN'; <br> ADOConnection2.Execute('SELECT * into [abc] FROM OpenDataSource( ' <br> +QuotedStr('Microsoft.Jet.OLEDB.4.0')+',' <br> +QuotedStr('Data Source=&quot;G:/mysmallexe/excel2sql/Server.MDB&quot;;Persist Security Info=False;Jet OLEDB:Database Password=happynewyear')+')...[Abc]'); <br><br>end; <br><br>procedure TForm1.btn_excel2accessClick(Sender: TObject); <br>begin <br>//excel2access <br> &nbsp;ADOConnection2.ConnectionString:= <br>'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=G:/mysmallexe/excel2sql/Server.MDB;' <br>+'Persist Security Info=False;Jet OLEDB:Database Password=happynewyear'; <br>ADOConnection2.Execute('SELECT * into [abc] FROM [excel 8.0;database=G:/mysmallexe/excel2sql/yp.xls].[abc$]'); <br>end; <br><br>procedure TForm1.btn_access2excelClick(Sender: TObject); <br>begin <br>//access2excel <br> ADOConnection2.ConnectionString:= <br>'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=G:/mysmallexe/excel2sql/yp.xls;' <br>+'Extended Properties=excel 8.0;Persist Security Info=False'; <br>ADOConnection2.Execute('SELECT * into abc &nbsp;from [G:/mysmallexe/excel2sql/Server.MDB;pwd=happynewyear].abc'); <br><br>end; <br><br> <br>来自: chenshaizi, 时间: 2003-11-28 15:11:00, ID: 2320794 &nbsp;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br> <br>来自: lushaox, 时间: 2003-11-29 19:41:00, ID: 2324163 &nbsp;<br>To 碧血剑 <br> &nbsp;如果Excle表中有多个工作表[Sheet]时怎样做才能同时将所有的工作表导入到Access中? <br>谢谢! <br><br> <br>来自: chenshaizi, 时间: 2003-11-29 20:39:00, ID: 2324240 &nbsp;<br>lushaox: <br>一下子导入好像不行,还是一个一个的导入吧 <br> <br>来自: icet, 时间: 2003-11-29 22:28:00, ID: 2324339 &nbsp;<br><br>写个循环不就可以了? <br><br> <br>来自: 酸菜炒牛肉, 时间: 2003-11-29 22:35:00, ID: 2324344 &nbsp;<br>碧血剑大侠:您好!我是DELPHI的初学者,我不知道怎样在DELPHI程序里将EXECL表格的数据导入ORACLE数据库中的一个表里去!求教!!!! <br>SQL&gt; desc lpeng_cwfk_ly; <br>Name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Null? &nbsp; &nbsp;Type <br>------------------------------- -------- ---- <br>STORE_NO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NUMBER(3) <br>SUPPL_NO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NOT NULL NUMBER(5) <br>BUYER_UID &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NOT NULL VARCHAR2(8) <br>NAME &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VARCHAR2(40) <br>PAY_PER &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NUMBER(3) <br>NET_AMNT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NUMBER(15,2) <br>PERC &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NUMBER(6,3) <br>AMOUNT_VAT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NUMBER(15,2) <br>TOTAL_NET_AMNT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NUMBER(15,2) <br>DUE_DATE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DATE <br>EXCEL 内容 <br>4 23871 联营F4 南宁市安泰食品厂F4联营 30 35,582.46 0.17 6,049.02 41,631.48 03-9-30 <br>4 23872 联营F4 南宁市佳美粮油食品有限公司F4联营 30 43,847.48 0.17 7,454.07 51,301.55 03-9-30 <br>4 23873 联营F4 南宁柏顿波多诺食品有限公司F4联营 30 59,942.92 0.17 10,190.30 70,133.21 03-9-30 <br>4 23874 联营F4 广西皇氏生物工程乳业有限公司F4联营 30 11,788.11 0.17 2,003.98 13,792.09 03-9-30 <br>4 23876 联营F4 南宁市一品轩食品有限责任公司F4联营 30 43,258.86 0.17 7,354.01 50,612.87 03-9-30 <br>4 23877 联营F4 南宁市百益实业有限责任公司F4联营 30 60,034.16 0.17 10,205.81 70,239.97 03-9-30 <br>4 22380 联营F1 南宁市桂乐农业综合开发公司 30 2,773.01 0.13 414.36 3,187.37 03-9-30 <br>4 22804 联营F1 蔬菜联营——耿娟 30 604.82 0.13 90.38 695.20 03-9-30 <br>4 22879 联营F1 南宁市蜜博士蜂产品经营部 30 4,877.16 0.13 728.77 5,605.93 03-9-30 <br>4 23164 联营F1 南宁市韩林食品经营部(联营F1) 30 232.87 0.13 34.80 267.67 03-9-30 <br><br><br> <br>来自: lushaox, 时间: 2003-11-30 0:44:00, ID: 2324422 &nbsp;<br>to icet、chenshaizi: <br> &nbsp; 谢谢你们的回答,由于我的excle表在导入的时候是不知道有多少个[sheet]的,工作表的表名也不知道。所以不能判断有几个工作表。请问有什么办法可以直接读取工作表的表名和判断有几个工作表里面有内容。 <br> <br>来自: chenshaizi, 时间: 2003-11-30 12:32:00, ID: 2324736 &nbsp;<br>ADOConnection1.ConnectionString:='Provider=SQLOLEDB.1;Password=KCSOFT58;Persist Security Info=True;User ID=SA;Initial Catalog=KCSOFT_HIS;Data Source=CHEN'; <br>取所有表名 <br>ADOConnection1.GetTableNames(combobox1.items); <br>这样得到的表是这样的 <br>如excel有sheet1,sheet2 <br>则 <br>combobox1.items为 <br>sheet1 <br>sheet1$ <br>sheet2 <br>sheet2$ <br>为什么这样别问我, <br>取得真正不重复的表名,你可以 <br>for i:=0 to combobox1.items.count-1 to <br> &nbsp;if i mod 2&lt;&gt;0 then <br> &nbsp; combobox1.items.add(combobox1.items.string) <br> <br>来自: lxm7805, 时间: 2003-11-30 16:47:00, ID: 2325018 &nbsp;<br>试了几个,真的不错,有空再慢慢琢磨,谢谢楼主!!!! <br> <br>来自: lushaox, 时间: 2003-11-30 16:48:00, ID: 2325020 &nbsp;<br>to chenshaizi: <br> &nbsp; &nbsp;我按你的说法去做,但combobox只有~TMPCLP144421和~TMPCLP158241和数据库的表名啊 <br>是不是需要sql server服务器才能实现呢? <br> <br>来自: icet, 时间: 2003-11-30 22:55:00, ID: 2325398 &nbsp;<br>to lushaox: <br> 我替chenshaizi大侠回答回答了。 <br> 你首先要得到EXCEL中所有的sheets的名字。这个方法是首先按照chenshaizi的 <br>方法建立一个连接该EXCEL文件的AdoConnection. <br> 然后调用这个Adoconnection的gettablenames方法,就如chenshaizi上面所说的 <br>一样,可以把它们放到combobox或者是listbox等TstringList里面去。这里面得到 <br>的结果应该就已经是你的EXCEL文件的所有的sheets名字了(有个$号的。不会重复 <br>)。 <br> 接着你就可以应用楼主的那个语句直接select from 了,或者是opendatasource <br>了。select 出来了,insert, select into就没有问题了。 <br> <br>来自: doll_paul, 时间: 2003-11-30 23:22:00, ID: 2325409 &nbsp;<br>UP一下吧。不过,ADO连接和操作DBF,不是什么新鲜事啊,楼主! <br><br>小弟可能说的不对,别骂我,呵呵~~ <br> <br>来自: 酸菜炒牛肉, 时间: 2003-12-01 12:24:00, ID: 2326140 &nbsp;<br>个位大侠!帮帮忙啊!!! <br><br>要将这样的EXCEL数据导入这面的表我应该怎样写代码呢!!给100分!!!!我刚上这论坛,就200分!如果你们觉得少,我还可以再加100!!!!! <br>SQL&gt; desc lpeng_cwfk_ly; <br>Name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Null? &nbsp; &nbsp;Type <br>------------------------------- -------- ---- <br>STORE_NO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NUMBER(3) <br>SUPPL_NO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NOT NULL NUMBER(5) <br>BUYER_UID &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NOT NULL VARCHAR2(8) <br>NAME &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VARCHAR2(40) <br>PAY_PER &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NUMBER(3) <br>NET_AMNT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NUMBER(15,2) <br>PERC &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NUMBER(6,3) <br>AMOUNT_VAT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NUMBER(15,2) <br>TOTAL_NET_AMNT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NUMBER(15,2) <br>DUE_DATE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DATE <br>EXCEL 内容 <br>4 &nbsp;23871 &nbsp;联营F4 &nbsp;南宁市安泰食品厂F4联营 &nbsp;30 &nbsp;35,582.46 &nbsp;0.17 &nbsp;6,049.02 &nbsp;41,631.48 &nbsp;03-9-30 <br>4 &nbsp;23872 &nbsp;联营F4 &nbsp;南宁市佳美粮油食品有限公司F4联营 &nbsp;30 &nbsp;43,847.48 &nbsp;0.17 &nbsp;7,454.07 &nbsp;51,301.55 &nbsp;03-9-30 <br>4 &nbsp;23873 &nbsp;联营F4 &nbsp;南宁柏顿波多诺食品有限公司F4联营 &nbsp;30 &nbsp;59,942.92 &nbsp;0.17 &nbsp;10,190.30 &nbsp;70,133.21 &nbsp;03-9-30 <br>4 &nbsp;23874 &nbsp;联营F4 &nbsp;广西皇氏生物工程乳业有限公司F4联营 &nbsp;30 &nbsp;11,788.11 &nbsp;0.17 &nbsp;2,003.98 &nbsp;13,792.09 &nbsp;03-9-30 <br>4 &nbsp;23876 &nbsp;联营F4 &nbsp;南宁市一品轩食品有限责任公司F4联营 &nbsp;30 &nbsp;43,258.86 &nbsp;0.17 &nbsp;7,354.01 &nbsp;50,612.87 &nbsp;03-9-30 <br>4 &nbsp;23877 &nbsp;联营F4 &nbsp;南宁市百益实业有限责任公司F4联营 &nbsp;30 &nbsp;60,034.16 &nbsp;0.17 &nbsp;10,205.81 &nbsp;70,239.97 &nbsp;03-9-30 <br>4 &nbsp;22380 &nbsp;联营F1 &nbsp;南宁市桂乐农业综合开发公司 &nbsp;30 &nbsp;2,773.01 &nbsp;0.13 &nbsp;414.36 &nbsp;3,187.37 &nbsp;03-9-30 <br>4 &nbsp;22804 &nbsp;联营F1 &nbsp;蔬菜联营——耿娟 &nbsp;30 &nbsp;604.82 &nbsp;0.13 &nbsp;90.38 &nbsp;695.20 &nbsp;03-9-30 <br>4 &nbsp;22879 &nbsp;联营F1 &nbsp;南宁市蜜博士蜂产品经营部 &nbsp;30 &nbsp;4,877.16 &nbsp;0.13 &nbsp;728.77 &nbsp;5,605.93 &nbsp;03-9-30 <br>4 &nbsp;23164 &nbsp;联营F1 &nbsp;南宁市韩林食品经营部(联营F1) &nbsp;30 &nbsp;232.87 &nbsp;0.13 &nbsp;34.80 &nbsp;267.67 &nbsp;03-9-30 <br><br><br><br> <br>来自: xuanne, 时间: 2003-12-03 11:54:00, ID: 2330619 &nbsp;<br>楼主用你的第2个方法试,将EXCEL导入ACCESS, <br>ADOConnection1.Connected := True; <br>ADOConnection1.Execute('Select * Into 订单表 From [excel 8.0;Database=c:/temp].订单.xls'); <br>运行时报打不开文件c:/temp,已被其他用户打开或权限不够?为何?还有ACCESS中的表是否要先建好还是自动生成? <br><br> <br>来自: icet, 时间: 2003-12-03 12:25:00, ID: 2330693 &nbsp;<br>楼上的错了。应该是: <br>ADOConnection1.Execute('Select * Into 订单表 From [excel 8.0;Database=c:/temp/订单.xls].sheetname$'); <br> <br>来自: xuanne, 时间: 2003-12-03 14:41:00, ID: 2331149 &nbsp;<br>楼上的再请教下,sheetname$是指什么呀?编译说$是无效字符. <br> <br>来自: icet, 时间: 2003-12-03 20:04:00, ID: 2332018 &nbsp;<br>就是你的sheet的名字加上一个$符号。 <br>编绎说是无效字符不应该吧。 <br>因为这个是在引号之内,DELPHI编绎时不检验的。 <br> <br>来自: icet, 时间: 2003-12-03 20:12:00, ID: 2332032 &nbsp;<br>我试了一下似乎这种形式不行。 <br>你改用opendatasouce算了。那是行的。 <br>试了N遍的。 <br> <br>来自: xuanne, 时间: 2003-12-04 11:43:00, ID: 2333109 &nbsp;<br>涓嶅ソ鎰忔??鍐嶈?鏁欎笅,鎴戠敤涓嬮潰璇?彞杩愯? <br>ADOConnection2.Execute('SELECT * into abc FROM OpenDataSource(''Microsoft.Jet.OLEDB.4.0'',''Data Source=&quot;C:/1.xls&quot;;Extended Properties=Excel 8.0'')...[Sheet1$]'); <br>鎶?FROM瀛愬彞璇?硶閿欒?&quot;; <br>鑰岀敤 <br>ADOConnection1.Execute('select * into abc from [excel 8.0;database=''c:/1.xls''].[Sheet1$]'); <br>鎶?涓嶈兘鏇存柊,鏁版嵁搴撴垨瀵硅薄涓哄彧璇? <br>璇烽棶閭i儴鍒嗛敊浜?璋㈣阿! <br> <br>来自: xuanne, 时间: 2003-12-04 11:51:00, ID: 2333128 &nbsp;<br>字体不清楚,重发.是这样的,我用下面语句 <br>ADOConnection2.Execute('SELECT * into abc FROM OpenDataSource(''Microsoft.Jet.OLEDB.4.0'',''Data Source=&quot;C:/1.xls&quot;;Extended Properties=Excel 8.0'')...[Sheet1$]'); <br>报&quot;FROM子句语法出错&quot; <br>而用 <br>ADOConnection1.Execute('select * into abc from [excel 8.0;database=''c:/1.xls''].[Sheet1$]'); <br>报&quot;不能更新,数据库或对象为只读&quot; <br>哪位高手指点下,谢谢! <br> <br>来自: guxizhw, 时间: 2003-12-04 12:01:00, ID: 2333160 &nbsp;<br>收藏先,哈哈,好东西阿,好东西 <br> <br>来自: kofxdm, 时间: 2003-12-04 14:30:00, ID: 2333607 &nbsp;<br>COOL <br> <br>来自: zyjsjwl, 时间: 2003-12-04 14:56:00, ID: 2333697 &nbsp;<br>为什么会报错?说什么缺少右引号,下面的语句哪儿写错了? <br>我在查询分析器里一切正常,在程序中写就报错: <br>with query do <br>begin <br> Close; <br> SQL.Clear; <br> SQL.Add('SELECT * into tab_Tmp FROM OpenDataSource('+''''); <br> SQL.Add('Microsoft.Jet.OLEDB.4.0'+''','+''''); <br> SQL.Add('Data Source=&quot;C:&quot;;User ID=Admin;Password=;Extended properties=dBase IV'+''')'+'...asd'); <br> try <br> &nbsp; ExecSQL; <br> except <br> &nbsp; ... <br> end; <br>end; <br><br>我也试过用QuotedStr()函数来加引号,也不行 <br> <br>来自: wgjxnm, 时间: 2003-12-04 20:57:00, ID: 2334559 &nbsp;<br>顶到前去 <br> <br>来自: chenshaizi, 时间: 2003-12-04 21:00:00, ID: 2334564 &nbsp;<br>to:zyjsjwl <br>看清楚了是 <br>ADOConnection1 <br>而不是adoquery1 <br> <br>来自: ququhu, 时间: 2003-12-07 15:56:00, ID: 2339458 &nbsp;<br>各位,看了之后获益颇多我有两件事不是很明白 <br>1.ADOConnection1.Execute,里面的字符串有长度限制吗? <br> 我写了个,因为字符串太长,它说长度超出限制了,如果这样,可以用什么方法代替呢? <br>2.我现在想写的是个远程的,只知道某ADOCONNECTTION的连接,其它的一概不知,想从远程 数据库导出成DBF文件。 <br> 连接字符串该怎么引用呢。 <br> <br>来自: chenshaizi, 时间: 2003-12-07 16:01:00, ID: 2339465 &nbsp;<br>ADOConnection1报字符串过长,还真的没有办法,只能 优化你的sql语句了 <br> <br>来自: ququhu, 时间: 2003-12-07 16:50:00, ID: 2339529 &nbsp;<br>我看了一下,从SQL SERVER里面导出数据一般都是这个形式 <br>SELECT * into table &nbsp;FROM Tab1 IN [ODBC] <br>[ODBC;Driver=SQL Server;UID=sa;PWD=;Server=127.0.0.1;DataBase=Demo;] <br>用的是ODBC,那么如果不用这个连接呢,连接的后面的那些资料可以从哪里看,我想弄明白这些的真正的意思。 <br>就是想明白 IN [ODBC] <br>[ODBC;Driver=SQL Server;UID=sa;PWD=;Server=127.0.0.1;DataBase=Demo;]这句话的内容是什么意思,如果有别的连接方法的话,也想知道其它的连接字符串的写法。我想肯定有很多想弄明白到底是怎么回事的朋友吧。 <br><br> <br>来自: tooper, 时间: 2003-12-08 11:54:00, ID: 2340773 &nbsp;<br>学习,牛! <br> <br>来自: chenshaizi, 时间: 2003-12-08 11:57:00, ID: 2340776 &nbsp;<br>[ODBC;Driver=SQL Server;UID=sa;PWD=;Server=127.0.0.1;DataBase=Demo;] <br>Driver:在注册表的 <br>HKEY_LOCAL_MACHINE/Software/ODBC/ODBCINST.INI/ODBC Drivers <br>下面都是系统里已经安装的odbc驱动。 <br>UID:用户名 <br>PWD:密码 <br>Server:服务器名字或IP <br>DataBase:数据库名字 <br> <br>来自: zyjsjwl, 时间: 2003-12-09 19:38:00, ID: 2343434 &nbsp;<br>to chenshaizi: <br>谢谢,我已经解决了,用SQL监视器查出问题来了,呵呵,应该这样写: <br>with query do <br>begin <br>Close; <br>SQL.Clear; <br>SQL.Add('SELECT * into tab_Tmp FROM OpenDataSource('+'''' <br> &nbsp; &nbsp; &nbsp; +'Microsoft.Jet.OLEDB.4.0'+''','+'''' <br> &nbsp; &nbsp; &nbsp; +'Data Source=''''C:'''';User ID=Admin;Password=;Extended properties=dBase IV'+''')'+'...asd'); <br>try <br> &nbsp;ExecSQL; <br>except <br> &nbsp;... <br>end; <br>end; <br><br>BTW:我用的是BDE <br><br> <br>来自: chenshaizi, 时间: 2003-12-09 16:59:00, ID: 2343441 &nbsp;<br>解决了就好 <br> <br>来自: Liuren_flf, 时间: 2003-12-10 14:17:00, ID: 2343642 &nbsp;<br>VFP6.0 —— SQL SERVER &nbsp;如何导入导出呢,哪位大侠调试成功过吗? <br> <br>来自: zbsfg, 时间: 2003-12-10 14:15:00, ID: 2345401 &nbsp;<br>佩服呀,收藏 <br> <br>来自: tomsyang, 时间: 2003-12-11 11:00:00, ID: 2347113 &nbsp;<br>对不起,我是个菜鸟。刚刚接触delphi,我现在就有一个你们讨论的问题,我就是有文本数据,现在要到入到数据库中,看到这个贴子后,我在实验到入到access中,但是现在报错,希望大家能帮我看看。谢谢。 <br><br>错误“不能重复定义字段” <br> <br>来自: tomsyang, 时间: 2003-12-11 11:06:00, ID: 2347131 &nbsp;<br>我写的是: <br><br>ADOConnection1.Connected := True; <br>ADOConnection1.Execute('Select * into insertda From [Text;Database=c:/DataBaseFile].ROAM.TG_CDR10_MWAP.txt'); <br><br>我的txt是从oracle中导出来的,access中的表insertda要怎么定义呀,是这个出问题了吗? <br> <br>来自: lyjgs.168, 时间: 2003-12-11 11:16:00, ID: 2347173 &nbsp;<br>不知道这能不能用在异构数据库而且表结构也是异构的情况下呢; <br>比如:A表的X加Y字段对B表的Y字段, <br> <br>来自: tomsyang, 时间: 2003-12-11 11:28:00, ID: 2347224 &nbsp;<br>&quot;W20031014991.007&quot;,&quot;118588899&quot;,&quot;11&quot;,&quot;whgw12&quot;,&quot;999001&quot;,&quot;4&quot;,&quot;13579883800&quot;,&quot;900506&quot;,&quot;03201003&quot;,&quot;01&quot;,&quot;0&quot;,&quot;02&quot;,&quot;20031014112449&quot;,&quot;20031014112452&quot;,&quot;00&quot;,&quot;882&quot;,&quot;0991&quot;,&quot;991&quot;,&quot;03&quot;,&quot;0&quot;,&quot;0&quot;,&quot;1103061200542288&quot;,&quot;T&quot;,&quot;910&quot;,&quot;6&quot;,&quot;W&quot; <br><br>上面的就是一条完整的数据,客户提供每个字段倒出来的数据长度不固定。而且第一行不是字段定义请问搂住能解决吗?万分感谢了 <br> <br>来自: ququhu, 时间: 2003-12-11 13:52:00, ID: 2347613 &nbsp;<br>看来只能用ODBC相连了。 <br><br>楼主,我才知道用BatchMove可以转换成DBF,可是我用ACCESS可以成功,用SQL SERVER没有成功过,同志们用BatchMove把SQL SERVER表变成DBF可行吗? <br> <br>来自: tomsyang, 时间: 2003-12-11 14:49:00, ID: 2347768 &nbsp;<br>楼主: <br> &nbsp; 我写的上面的语句只能在access中建立那个结构的表,但是数据写不进去,这是什么问题呀 <br> <br>来自: ztplus, 时间: 2003-12-11 17:32:00, ID: 2348231 &nbsp;<br>关注中,顶。 <br>老说我水! <br> <br>来自: tomsyang, 时间: 2003-12-11 20:28:00, ID: 2348607 &nbsp;<br>楼主好: <br>大家好: <br>谢谢大家的帮助,我看到上面的文章解决了好多问题,但是现在我还有一个问题,对大家来说可能是小问题。那就是我再从text-&gt;sql server导数据时程序总报超时,我怎么才能解决呀。我想应当不是大的问题。可是我不清楚,还请帮助 <br> <br>来自: wvy, 时间: 2003-12-11 20:48:00, ID: 2348636 &nbsp;<br>感谢楼主,解决了我的问题!再次感谢! <br> <br>来自: zygtp, 时间: 2003-12-12 2:41:00, ID: 2348979 &nbsp;<br>用我的万能数据备份工具实现异构数据库的数据导入导出,下载地址:http://zygtp.my20.com <br> <br>来自: zlr_888_888, 时间: 2003-12-12 8:06:00, ID: 2349007 &nbsp;<br>高 <br> <br>来自: KQH0319, 时间: 2003-12-12 8:34:00, ID: 2349050 &nbsp;<br>学习中.......... <br> <br>来自: tomsyang, 时间: 2003-12-12 19:57:00, ID: 2350973 &nbsp;<br>请问大家,我如果想有选择得导数据该怎么办呢。这个我一直都没有实现。谢谢楼主,谢谢 <br>大家。 <br> <br>来自: tomsyang, 时间: 2003-12-12 20:00:00, ID: 2350980 &nbsp;<br>也就是在 <br><br>ADOConnection1.Execute('SELECT * into Operator11 &nbsp;FROM Operator IN [ODBC] <br>[ODBC;Driver=SQL Server;UID=sa;PWD=sa;Server=YangXF;DataBase=jfcx;]'); <br>的那个地方可以放where呀。我一直没有解决。还希望大家帮帮忙 <br> <br>来自: pslgoldgj, 时间: 2003-12-14 7:11:00, ID: 2352625 &nbsp;<br>[blue]给碧血剑鼓掌![/blue][:)][:)] <br> <br>来自: jettop, 时间: 2003-12-15 9:29:00, ID: 2353918 &nbsp;<br>我试图 MS Sql -&gt; Access 时 <br>用 <br>adoconnection1.execute('SELECT * into tab1 &nbsp;FROM tab1 IN [ODBC] [ODBC;Driver=SQL Server;UID=sa;PWD=;Server= 10.33.192.168;DataBase=DCMIS;]') ; <br>时,总提示 ODBC--SQL Server10.33.192.168找不到? <br>是什么原因? <br><br><br><br> <br>来自: skywin, 时间: 2003-12-15 9:38:00, ID: 2353935 &nbsp;<br>我猛顶,365下!!!! <br> <br>来自: wolfish, 时间: 2003-12-16 15:01:00, ID: 2357490 &nbsp;<br>TO: 碧血剑及各位大哥: <br> &nbsp;我用这种方法是把excel 导入到了sql 但是导入后的 列的序列怎么变了,我用 <br>insert into tablename SELECT * &nbsp;FROM OpenDataSource('''+ 'Microsoft.Jet.OLEDB.4.0'''+','''+ 'Data Source=&quot;d:/test.xls&quot;;Extended Properties=&quot;Excel 8.0;HDR=Yes;&quot;;Persist Security Info=False''' + ')...sheet1$ <br>把的:D:/test.xls 插入到 我在数据库中已经建立好的表tablename,就出现类型不匹配,我跟踪了一下是向tablename里插入数据的时候不是按照excel已有的列序 插入的,所以成这样了,问题: <br> 1,怎么让他往sql插入的时候按照excel的列序 插入? <br> 2,我发现插入数据后第一条丢了,这是什么原因? <br> <br>来自: 林妹妹, 时间: 2003-12-16 17:16:00, ID: 2357963 &nbsp;<br>如何将access &nbsp;的数据导入到oracle 中? 有无更简单一点的? <br> <br>来自: llo2003, 时间: 2003-12-16 17:58:00, ID: 2358097 &nbsp;<br>sql server --&gt;&gt; oracle <br><br>????? <br> <br>来自: hunyuan, 时间: 2003-12-17 0:20:00, ID: 2358602 &nbsp;<br>Access To Access <br>如果源Access有密码怎么办啊? <br> <br>来自: 林妹妹, 时间: 2003-12-17 8:30:00, ID: 2358701 &nbsp;<br>wind2000 写的access to oracle 程序好复杂我看不懂,只将数据导入以下写法为何出错? <br>query.sql.add(' SELECT * into bmk ') ; <br>query.sql.add('FROM OpenDataSource( 'Provider=Microsoft.Jet.OLEDB.4.0; '); <br>query.sql.add('Data Source=c:/temp/db1.mdb;Persist Security &nbsp;Info=False ' ); <br><br><br><br> <br>来自: Smile.java, 时间: 2003-12-17 9:51:00, ID: 2358983 &nbsp;<br>Access To Access <br>如果源Access有密码怎么办啊? &nbsp; <br><br>Access To Access <br>如果源Access有密码怎么办啊? &nbsp; <br> <br>来自: ffanpeng, 时间: 2003-12-17 21:25:00, ID: 2361082 &nbsp;<br>从Excel导数据到SQL2000中的出错: <br>SELECT * FROM OpenDataSource('Microsoft.Jet.OLEDB.4.0','Data Source=&quot;C:/INVB/b.xls&quot;;Extended Properties=&quot;Excel 5.0;HDR=Yes;&quot;;Persist Security Info=False')...sheet1$ <br>==== <br>在SQL-Query中执行出错误信息如下: <br>服务器: 消息 7399,级别 16,状态 1,行 1 <br>OLE DB 提供程序 'Microsoft.Jet.OLEDB.4.0' 报错。提供程序未给出有关错误的任何信息。 <br>OLE DB 错误跟踪[OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0' IDBInitialize::Initialize returned 0x80004005: &nbsp;提供程序未给出有关错误的任何信息。]。 <br>这怎摸解决 <br> <br>来自: pacific1979, 时间: 2003-12-18 11:49:00, ID: 2361966 &nbsp;<br>搂主:两个paradox的数据表A和B,不用batchmove如何把A的数据导入到B啊(A和B的结构相同,做到主索引相同的更新,不同的插入) &nbsp;急需 谢谢搂主了 <br><br> <br>来自: wchal, 时间: 2003-12-18 12:24:00, ID: 2362065 &nbsp;<br>TO:pacific1979 <br>下面是我程序中的一段程式中的代碼,功能和你說的一至. &nbsp; &nbsp; &nbsp; <br><br> &nbsp; &nbsp; MDDATA.ADOQuery2.Close; <br> &nbsp; &nbsp; MDDATA.ADOQuery2.SQL.Text:='select ZLDLDC.流水號,ZLDLDC.出貨日期 from ZLDLDC,YJJDK where ZLDLDC.流水號=YJJDK.流水號'; <br> &nbsp; &nbsp; MDDATA.ADOQuery2.Open; <br> &nbsp; &nbsp; ProgressBar1.Min:=0; <br> &nbsp; &nbsp; ProgressBar1.Max:=MDDATA.ADOQuery2.RecordCount; <br> &nbsp; &nbsp; ProgressBar1.Position:=0; <br> &nbsp; &nbsp; for i:=1 to MDDATA.ADOQuery2.RecordCount do//有的更新出貨日期 <br> &nbsp; &nbsp; &nbsp; begin <br> &nbsp; &nbsp; &nbsp; ProgressBar1.Position:=ProgressBar1.Position+1; <br> &nbsp; &nbsp; &nbsp; MDDATA.ADOQuery1.Close; <br> &nbsp; &nbsp; &nbsp; MDDATA.ADOQuery1.SQL.Text:='update YJJDK set 出貨日期= :RQ where (出貨日期 is NULL)and(流水號= :LSH)'; <br> &nbsp; &nbsp; &nbsp; MDDATA.ADOQuery1.Parameters.ParamByName('LSH').Value:=MDDATA.ADOQuery2.Fields[0].Value; <br> &nbsp; &nbsp; &nbsp; MDDATA.ADOQuery1.Parameters.ParamByName('RQ').Value:=MDDATA.ADOQuery2.Fields[1].Value; <br> &nbsp; &nbsp; &nbsp; MDDATA.ADOQuery1.ExecSQL; <br> &nbsp; &nbsp; &nbsp; MDDATA.ADOQuery2.Next; <br> &nbsp; &nbsp; &nbsp; end; <br><br> &nbsp; &nbsp; MDDATA.ADOQuery1.Close;//一次性插入沒有的 <br> &nbsp; &nbsp; MDDATA.ADOQuery1.SQL.Text:='insert into YJJDK select * from ZLDLDC where ZLDLDC.流水號 not in(select YJJDK.流水號 from YJJDK)'; <br> &nbsp; &nbsp; MDDATA.ADOQuery1.ExecSQL; <br> &nbsp; &nbsp; //ZLDLDC和YJJDK是兩個表名你的操作只要用SQL語句就可以搞定 <br> <br>来自: Smile.java, 时间: 2003-12-18 15:17:00, ID: 2362554 &nbsp;<br>Access To Access <br>如果源Access有密码怎么办啊? &nbsp; <br><br>Access To Access <br>如果源Access有密码怎么办啊? &nbsp; <br><br>Access To Access <br>如果源Access有密码怎么办啊? &nbsp; <br><br>Access To Access <br>如果源Access有密码怎么办啊? &nbsp; <br><br>非常着急,谢谢各位! <br><br>用OpenDataSource方式总提示From语句错误 <br>ADOConnect.Execute('select * into DataUp_Company from OpenDataSource(''Microsoft.Jet.OLEDB.4.0'',''Data Source=&quot;c:/test.mdb&quot;;Persist Security Info=False;Jet OLEDB:Database Password=hi'')...Data_Company'); <br> <br>来自: 吉祥雨, 时间: 2003-12-18 16:49:00, ID: 2362881 &nbsp;<br>好帖!!! <br><br>我也想完成Oracle to Oracle的功能。我还不会用ADO,要想实现有选择的 <br>导入导出应如何做? <br><br> <br>来自: memories, 时间: 2003-12-18 18:00:00, ID: 2363049 &nbsp;<br>顶。 <br>强人ing... <br> <br>来自: chenshaizi, 时间: 2003-12-18 23:15:00, ID: 2363603 &nbsp;<br>to:Smile.java, <br>来自:chenshaizi, 时间:2003-10-29 22:03:00, ID:2260739 | 编辑 <br>看我的 <br>adoconnection2.connectionstring:='Provider=Microsoft.Jet.OLEDB.4.0;Password=&quot;&quot;;User ID=Admin;Data Source=g:/server.xc;Mode=Share Deny None;Extended Properties=&quot;&quot;;Jet OLEDB:System database=&quot;&quot;;Jet OLEDB:Registry Path=&quot;&quot;;Jet OLEDB:Database Password=123456;Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password=&quot;&quot;;Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False'; <br>adoconnection2.connected:=true; <br>ADOConnection2.Execute( <br>'select * into admina from [G:/server_data.mdb;Pwd=123456].admin'); <br>目标数据库不能存在相同的表 <br><br><br><br>来自:chenshaizi, 时间:2003-10-29 22:04:00, ID:2260749 | 编辑 <br>还有更好的办法 <br>ADOConnection2.connectionstring:='同上' <br>ADOConnection2.Execute( <br>'insert into admin select * from [G:/server_data.mdb;Pwd=123456].admin'); <br>同一个表操作 <br>这只是简单的复制操作,主键它不认, <br> <br>来自: feelfly, 时间: 2003-12-19 9:00:00, ID: 2363771 &nbsp;<br>急问请问如何从sqlserver像这样导入MYSQL?MYSQL只有insert into ..select可以吗? <br>在线等,谢谢 <br> <br>来自: wind2000, 时间: 2003-12-19 9:17:00, ID: 2363818 &nbsp;<br>1.前一段去兰州出差了,所以有些问题没法及时回答,抱歉! <br>2.明天去泰港澳游了,高兴,发一段代码上来供大家参考! <br>3.以前测试过,大部分可以用,但也不敢担保一定可以正常运行,我现在也没有环境重新测试,只好你们自已试试了,有些参数自已要改的,我就不写了,有什么问题等半个月后我再来看看! <br><br>[FRM] <br>object Form1: TForm1 <br> Left = 194 <br> Top = 126 <br> Width = 544 <br> Height = 375 <br> Caption = '异构数据库数据互导' <br> Color = clBtnFace <br> Font.Charset = GB2312_CHARSET <br> Font.Color = clWindowText <br> Font.Height = -12 <br> Font.Name = '宋体' <br> Font.Style = [] <br> OldCreateOrder = False <br> OnCloseQuery = FormCloseQuery <br> PixelsPerInch = 96 <br> TextHeight = 12 <br> object labTime: TLabel <br> &nbsp; Left = 48 <br> &nbsp; Top = 312 <br> &nbsp; Width = 6 <br> &nbsp; Height = 12 <br> end <br> object GroupBox1: TGroupBox <br> &nbsp; Left = 8 <br> &nbsp; Top = 8 <br> &nbsp; Width = 220 <br> &nbsp; Height = 153 <br> &nbsp; Caption = ' Access ' <br> &nbsp; TabOrder = 0 <br> &nbsp; object Button1: TButton <br> &nbsp; &nbsp; Left = 15 <br> &nbsp; &nbsp; Top = 23 <br> &nbsp; &nbsp; Width = 90 <br> &nbsp; &nbsp; Height = 25 <br> &nbsp; &nbsp; Caption = 'Access-&gt;TXT' <br> &nbsp; &nbsp; TabOrder = 0 <br> &nbsp; &nbsp; OnClick = Button1Click <br> &nbsp; end <br> &nbsp; object Button3: TButton <br> &nbsp; &nbsp; Left = 15 <br> &nbsp; &nbsp; Top = 55 <br> &nbsp; &nbsp; Width = 90 <br> &nbsp; &nbsp; Height = 25 <br> &nbsp; &nbsp; Caption = 'Access-&gt;DBF' <br> &nbsp; &nbsp; TabOrder = 1 <br> &nbsp; &nbsp; OnClick = Button3Click <br> &nbsp; end <br> &nbsp; object Button4: TButton <br> &nbsp; &nbsp; Left = 15 <br> &nbsp; &nbsp; Top = 120 <br> &nbsp; &nbsp; Width = 90 <br> &nbsp; &nbsp; Height = 25 <br> &nbsp; &nbsp; Caption = 'Access-&gt;Access' <br> &nbsp; &nbsp; TabOrder = 3 <br> &nbsp; &nbsp; OnClick = Button4Click <br> &nbsp; end <br> &nbsp; object Button2: TButton <br> &nbsp; &nbsp; Left = 112 <br> &nbsp; &nbsp; Top = 23 <br> &nbsp; &nbsp; Width = 90 <br> &nbsp; &nbsp; Height = 25 <br> &nbsp; &nbsp; Caption = 'TXT-&gt;Access' <br> &nbsp; &nbsp; TabOrder = 4 <br> &nbsp; &nbsp; OnClick = Button2Click <br> &nbsp; end <br> &nbsp; object Button5: TButton <br> &nbsp; &nbsp; Left = 112 <br> &nbsp; &nbsp; Top = 55 <br> &nbsp; &nbsp; Width = 90 <br> &nbsp; &nbsp; Height = 25 <br> &nbsp; &nbsp; Caption = 'DBF-&gt;Access' <br> &nbsp; &nbsp; TabOrder = 5 <br> &nbsp; &nbsp; OnClick = Button5Click <br> &nbsp; end <br> &nbsp; object Button9: TButton <br> &nbsp; &nbsp; Left = 15 <br> &nbsp; &nbsp; Top = 88 <br> &nbsp; &nbsp; Width = 90 <br> &nbsp; &nbsp; Height = 25 <br> &nbsp; &nbsp; Caption = 'Access-&gt;Excel' <br> &nbsp; &nbsp; TabOrder = 2 <br> &nbsp; &nbsp; OnClick = Button9Click <br> &nbsp; end <br> &nbsp; object Button10: TButton <br> &nbsp; &nbsp; Left = 112 <br> &nbsp; &nbsp; Top = 88 <br> &nbsp; &nbsp; Width = 90 <br> &nbsp; &nbsp; Height = 25 <br> &nbsp; &nbsp; Caption = 'Excel-&gt;Access' <br> &nbsp; &nbsp; TabOrder = 6 <br> &nbsp; &nbsp; OnClick = Button10Click <br> &nbsp; end <br> end <br> object GroupBox2: TGroupBox <br> &nbsp; Left = 256 <br> &nbsp; Top = 8 <br> &nbsp; Width = 217 <br> &nbsp; Height = 153 <br> &nbsp; Caption = ' Oracle ' <br> &nbsp; TabOrder = 1 <br> &nbsp; object Button6: TButton <br> &nbsp; &nbsp; Left = 16 <br> &nbsp; &nbsp; Top = 88 <br> &nbsp; &nbsp; Width = 90 <br> &nbsp; &nbsp; Height = 25 <br> &nbsp; &nbsp; Caption = 'Oracle-&gt;Access' <br> &nbsp; &nbsp; TabOrder = 2 <br> &nbsp; &nbsp; OnClick = Button6Click <br> &nbsp; end <br> &nbsp; object Button7: TButton <br> &nbsp; &nbsp; Left = 16 <br> &nbsp; &nbsp; Top = 23 <br> &nbsp; &nbsp; Width = 90 <br> &nbsp; &nbsp; Height = 25 <br> &nbsp; &nbsp; Caption = 'Oracle-&gt;TXT' <br> &nbsp; &nbsp; Font.Charset = GB2312_CHARSET <br> &nbsp; &nbsp; Font.Color = clWindowText <br> &nbsp; &nbsp; Font.Height = -12 <br> &nbsp; &nbsp; Font.Name = '宋体' <br> &nbsp; &nbsp; Font.Style = [] <br> &nbsp; &nbsp; ParentFont = False <br> &nbsp; &nbsp; TabOrder = 0 <br> &nbsp; &nbsp; OnClick = Button7Click <br> &nbsp; end <br> &nbsp; object Button8: TButton <br> &nbsp; &nbsp; Left = 16 <br> &nbsp; &nbsp; Top = 120 <br> &nbsp; &nbsp; Width = 90 <br> &nbsp; &nbsp; Height = 25 <br> &nbsp; &nbsp; Caption = 'Oracle-&gt;Excel' <br> &nbsp; &nbsp; TabOrder = 3 <br> &nbsp; &nbsp; OnClick = Button8Click <br> &nbsp; end <br> &nbsp; object Button11: TButton <br> &nbsp; &nbsp; Left = 16 <br> &nbsp; &nbsp; Top = 55 <br> &nbsp; &nbsp; Width = 90 <br> &nbsp; &nbsp; Height = 25 <br> &nbsp; &nbsp; Caption = 'Oracle-&gt;DBF' <br> &nbsp; &nbsp; TabOrder = 1 <br> &nbsp; &nbsp; OnClick = Button11Click <br> &nbsp; end <br> &nbsp; object Button12: TButton <br> &nbsp; &nbsp; Left = 112 <br> &nbsp; &nbsp; Top = 23 <br> &nbsp; &nbsp; Width = 90 <br> &nbsp; &nbsp; Height = 25 <br> &nbsp; &nbsp; Caption = 'TXT-&gt;Oracle' <br> &nbsp; &nbsp; Font.Charset = GB2312_CHARSET <br> &nbsp; &nbsp; Font.Color = clWindowText <br> &nbsp; &nbsp; Font.Height = -12 <br> &nbsp; &nbsp; Font.Name = '宋体' <br> &nbsp; &nbsp; Font.Style = [] <br> &nbsp; &nbsp; ParentFont = False <br> &nbsp; &nbsp; TabOrder = 4 <br> &nbsp; &nbsp; OnClick = Button12Click <br> &nbsp; end <br> &nbsp; object Button13: TButton <br> &nbsp; &nbsp; Left = 112 <br> &nbsp; &nbsp; Top = 55 <br> &nbsp; &nbsp; Width = 90 <br> &nbsp; &nbsp; Height = 25 <br> &nbsp; &nbsp; Caption = 'DBF-&gt;Oracle' <br> &nbsp; &nbsp; TabOrder = 5 <br> &nbsp; &nbsp; OnClick = Button13Click <br> &nbsp; end <br> &nbsp; object Button14: TButton <br> &nbsp; &nbsp; Left = 112 <br> &nbsp; &nbsp; Top = 87 <br> &nbsp; &nbsp; Width = 90 <br> &nbsp; &nbsp; Height = 25 <br> &nbsp; &nbsp; Caption = 'Access-&gt;Oracle' <br> &nbsp; &nbsp; TabOrder = 6 <br> &nbsp; &nbsp; OnClick = Button14Click <br> &nbsp; end <br> &nbsp; object Button15: TButton <br> &nbsp; &nbsp; Left = 112 <br> &nbsp; &nbsp; Top = 120 <br> &nbsp; &nbsp; Width = 90 <br> &nbsp; &nbsp; Height = 25 <br> &nbsp; &nbsp; Caption = 'Excel-&gt;Oracle' <br> &nbsp; &nbsp; TabOrder = 7 <br> &nbsp; &nbsp; OnClick = Button15Click <br> &nbsp; end <br> end <br> object StatusBar: TStatusBar <br> &nbsp; Left = 0 <br> &nbsp; Top = 329 <br> &nbsp; Width = 536 <br> &nbsp; Height = 19 <br> &nbsp; Panels = &lt; <br> &nbsp; &nbsp; item <br> &nbsp; &nbsp; &nbsp; Text = '耗时:' <br> &nbsp; &nbsp; &nbsp; Width = 32 <br> &nbsp; &nbsp; end <br> &nbsp; &nbsp; item <br> &nbsp; &nbsp; &nbsp; Width = 100 <br> &nbsp; &nbsp; end <br> &nbsp; &nbsp; item <br> &nbsp; &nbsp; &nbsp; Width = 50 <br> &nbsp; &nbsp; end&gt; <br> &nbsp; SimplePanel = False <br> end <br> object Button16: TButton <br> &nbsp; Left = 24 <br> &nbsp; Top = 176 <br> &nbsp; Width = 90 <br> &nbsp; Height = 25 <br> &nbsp; Caption = 'TXT-&gt;DBF' <br> &nbsp; TabOrder = 3 <br> &nbsp; OnClick = Button16Click <br> end <br> object AccessConnection: TADOConnection <br> &nbsp; ConnectionString = <br> &nbsp; &nbsp; 'Provider=Microsoft.Jet.OLEDB.4.0;Password=&quot;&quot;;Data Source=E:/Delp' + <br> &nbsp; &nbsp; 'hilx/ADOSQL/PH/demo.mdb;Persist Security Info=True' <br> &nbsp; LoginPrompt = False <br> &nbsp; Mode = cmShareDenyNone <br> &nbsp; Provider = 'Microsoft.Jet.OLEDB.4.0' <br> &nbsp; OnExecuteComplete = AccessConnectionExecuteComplete <br> &nbsp; OnWillExecute = AccessConnectionWillExecute <br> &nbsp; Left = 228 <br> &nbsp; Top = 95 <br> end <br> object ExcelConnection: TADOConnection <br> &nbsp; ConnectionString = <br> &nbsp; &nbsp; 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=f:/aaa.xls;Extended' + <br> &nbsp; &nbsp; ' Properties=Excel 8.0;Persist Security Info=False' <br> &nbsp; LoginPrompt = False <br> &nbsp; Mode = cmShareDenyNone <br> &nbsp; Provider = 'Microsoft.Jet.OLEDB.4.0' <br> &nbsp; OnExecuteComplete = AccessConnectionExecuteComplete <br> &nbsp; OnWillExecute = AccessConnectionWillExecute <br> &nbsp; Left = 228 <br> &nbsp; Top = 128 <br> end <br> object TxtConnection: TADOConnection <br> &nbsp; ConnectionString = <br> &nbsp; &nbsp; 'Provider=Microsoft.Jet.OLEDB.4.0;Password=&quot;&quot;;Data Source=f:/temp' + <br> &nbsp; &nbsp; ';Extended Properties=&quot;text;HDR=YES;FMT=Delimited&quot;;Persist Securi' + <br> &nbsp; &nbsp; 'ty Info=True' <br> &nbsp; LoginPrompt = False <br> &nbsp; Mode = cmShareDenyNone <br> &nbsp; Provider = 'Microsoft.Jet.OLEDB.4.0' <br> &nbsp; OnExecuteComplete = AccessConnectionExecuteComplete <br> &nbsp; OnWillExecute = AccessConnectionWillExecute <br> &nbsp; Left = 228 <br> &nbsp; Top = 31 <br> end <br> object DBFConnection: TADOConnection <br> &nbsp; ConnectionString = <br> &nbsp; &nbsp; 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=f:/;Extended Proper' + <br> &nbsp; &nbsp; 'ties=DBase 5.0;Persist Security Info=False' <br> &nbsp; LoginPrompt = False <br> &nbsp; Provider = 'Microsoft.Jet.OLEDB.4.0' <br> &nbsp; OnExecuteComplete = AccessConnectionExecuteComplete <br> &nbsp; OnWillExecute = AccessConnectionWillExecute <br> &nbsp; Left = 228 <br> &nbsp; Top = 63 <br> end <br> object OracleConnection: TADOConnection <br> &nbsp; ConnectionString = <br> &nbsp; &nbsp; 'Provider=MSDASQL.1;Password=bklskf;Persist Security Info=True;Us' + <br> &nbsp; &nbsp; 'er ID=bklskf;Data Source=bkls' <br> &nbsp; Provider = 'MSDASQL.1' <br> &nbsp; Left = 228 <br> &nbsp; Top = 161 <br> end <br>end <br><br>[Unit] <br>unit Unit1; <br><br>interface <br><br>uses <br> Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, <br> Dialogs, StdCtrls, DB, ADODB, ComCtrls; <br><br>type <br> TForm1 = class(TForm) <br> &nbsp; AccessConnection: TADOConnection; <br> &nbsp; GroupBox1: TGroupBox; <br> &nbsp; Button1: TButton; <br> &nbsp; Button3: TButton; <br> &nbsp; Button4: TButton; <br> &nbsp; Button2: TButton; <br> &nbsp; Button5: TButton; <br> &nbsp; GroupBox2: TGroupBox; <br> &nbsp; Button6: TButton; <br> &nbsp; Button7: TButton; <br> &nbsp; labTime: TLabel; <br> &nbsp; StatusBar: TStatusBar; <br> &nbsp; ExcelConnection: TADOConnection; <br> &nbsp; Button8: TButton; <br> &nbsp; TxtConnection: TADOConnection; <br> &nbsp; Button9: TButton; <br> &nbsp; Button10: TButton; <br> &nbsp; Button11: TButton; <br> &nbsp; DBFConnection: TADOConnection; <br> &nbsp; Button12: TButton; <br> &nbsp; Button13: TButton; <br> &nbsp; Button14: TButton; <br> &nbsp; Button15: TButton; <br> &nbsp; OracleConnection: TADOConnection; <br> &nbsp; Button16: TButton; <br> &nbsp; procedure Button1Click(Sender: TObject); <br> &nbsp; procedure Button2Click(Sender: TObject); <br> &nbsp; procedure Button3Click(Sender: TObject); <br> &nbsp; procedure Button4Click(Sender: TObject); <br> &nbsp; procedure Button5Click(Sender: TObject); <br> &nbsp; procedure Button6Click(Sender: TObject); <br> &nbsp; procedure AccessConnectionExecuteComplete(Connection: TADOConnection; <br> &nbsp; &nbsp; RecordsAffected: Integer; const Error: Error; <br> &nbsp; &nbsp; var EventStatus: TEventStatus; const Command: _Command; <br> &nbsp; &nbsp; const Recordset: _Recordset); <br> &nbsp; procedure AccessConnectionWillExecute(Connection: TADOConnection; <br> &nbsp; &nbsp; var CommandText: WideString; var CursorType: TCursorType; <br> &nbsp; &nbsp; var LockType: TADOLockType; var CommandType: TCommandType; <br> &nbsp; &nbsp; var ExecuteOptions: TExecuteOptions; var EventStatus: TEventStatus; <br> &nbsp; &nbsp; const Command: _Command; const Recordset: _Recordset); <br> &nbsp; procedure Button7Click(Sender: TObject); <br> &nbsp; procedure Button8Click(Sender: TObject); <br> &nbsp; procedure Button9Click(Sender: TObject); <br> &nbsp; procedure Button10Click(Sender: TObject); <br> &nbsp; procedure Button11Click(Sender: TObject); <br> &nbsp; procedure Button12Click(Sender: TObject); <br> &nbsp; procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); <br> &nbsp; procedure Button13Click(Sender: TObject); <br> &nbsp; procedure Button14Click(Sender: TObject); <br> &nbsp; procedure Button15Click(Sender: TObject); <br> &nbsp; procedure Button16Click(Sender: TObject); <br> private <br> &nbsp; { Private declarations } <br> public <br> &nbsp; { Public declarations } <br> end; <br><br>var <br> Form1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : TForm1; <br> sSql &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: string; <br> iT1, iT2 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: integer; <br><br>implementation <br><br>{$R *.dfm} <br><br>procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean); <br>begin <br> TxtConnection.Close; <br> DBFConnection.Close; <br> AccessConnection.Close; <br> ExcelConnection.Close; <br>end; <br><br>procedure TForm1.AccessConnectionExecuteComplete(Connection: TADOConnection; <br> RecordsAffected: Integer; const Error: Error; <br> var EventStatus: TEventStatus; const Command: _Command; <br> const Recordset: _Recordset); <br>begin <br> //记时1 <br> iT2 := GetTickCount; <br> StatusBar.Panels[1].Text := FormatFloat('#,##', iT2 - iT1) + '毫秒'; <br> StatusBar.Panels[2].Text := '共导记录:' + IntToStr(RecordsAffected) + '条'; <br>end; <br><br>procedure TForm1.AccessConnectionWillExecute(Connection: TADOConnection; <br> var CommandText: WideString; var CursorType: TCursorType; <br> var LockType: TADOLockType; var CommandType: TCommandType; <br> var ExecuteOptions: TExecuteOptions; var EventStatus: TEventStatus; <br> const Command: _Command; const Recordset: _Recordset); <br>begin <br> iT1 := GetTickCount; <br>end; <br><br>//================================================================= <br>//Access <br>//Access-&gt;TXT <br>procedure TForm1.Button1Click(Sender: TObject); <br>begin <br> sSql := 'select * into [Text;Database=f:/].aaa.txt from demo'; <br> with AccessConnection do <br> &nbsp; begin <br> &nbsp; &nbsp; Connected := True; <br> &nbsp; &nbsp; Execute(sSql); <br> &nbsp; end; <br>end; <br><br>//Access-&gt;DBF <br>procedure TForm1.Button3Click(Sender: TObject); <br>begin <br> sSql := 'select * into aaa in ''f:/'' ''dbase 5.0;'' from demo'; <br> with AccessConnection do <br> &nbsp; begin <br> &nbsp; &nbsp; Connected := True; <br> &nbsp; &nbsp; Execute(sSql); <br> &nbsp; end; <br>end; <br><br>//Access-&gt;Excel <br>//注意:前一个aaa为Excel文件中的aaa页,后一个aaa为Access文件demo.mdb中的一个表名 <br>procedure TForm1.Button9Click(Sender: TObject); <br>begin <br> sSql := <br> &nbsp; 'select * into aaa from aaa in ''E:/Delphilx/ADOSQL/PH/demo.mdb'''; <br> with ExcelConnection do <br> &nbsp; begin <br> &nbsp; &nbsp; Connected := True; <br> &nbsp; &nbsp; Execute(sSql); <br> &nbsp; end; <br>end; <br><br>//Access-&gt;Access <br>procedure TForm1.Button4Click(Sender: TObject); <br>begin <br> sSql := 'select * into aaa from demo in ''E:/Delphilx/ADOSQL/PH/demo.mdb'''; <br> with AccessConnection do <br> &nbsp; begin <br> &nbsp; &nbsp; Connected := True; <br> &nbsp; &nbsp; Execute(sSql); <br> &nbsp; end; <br>end; <br><br>//TXT-&gt;Access <br>procedure TForm1.Button2Click(Sender: TObject); <br>begin <br> sSql := 'select * into uform from [Text;Database=f:/].form.txt'; <br> with AccessConnection do <br> &nbsp; begin <br> &nbsp; &nbsp; Connected := True; <br> &nbsp; &nbsp; Execute(sSql); <br> &nbsp; end; <br>end; <br><br>//DBF-&gt;Access <br>procedure TForm1.Button5Click(Sender: TObject); <br>begin <br> sSql := 'select * into aaa from aaa in ''f:/'' ''dbase 5.0;'''; <br> with AccessConnection do <br> &nbsp; begin <br> &nbsp; &nbsp; Connected := True; <br> &nbsp; &nbsp; Execute(sSql); <br> &nbsp; end; <br>end; <br><br>//Excel-&gt;Access <br>//[aaa$]-&gt;Excel文件aaa.xls中的aaa页 <br>procedure TForm1.Button10Click(Sender: TObject); <br>begin <br> sSql := <br> &nbsp; 'select * into bbb from [excel 8.0;database=f:/aaa.xls].[aaa$]'; <br> with AccessConnection do <br> &nbsp; begin <br> &nbsp; &nbsp; Connected := True; <br> &nbsp; &nbsp; Execute(sSql); <br> &nbsp; end; <br>end; <br><br>//================================================================= <br>//Oracle <br>//Oracle-&gt;Access <br>procedure TForm1.Button6Click(Sender: TObject); <br>begin <br> sSql := <br> &nbsp; 'select * into ouform from ouform in [ODBC][ODBC;Driver={Microsoft ODBC for Oracle};UID=bklskf;PWD=bklskf;SERVER=bkls;]'; <br> with AccessConnection do <br> &nbsp; begin <br> &nbsp; &nbsp; Connected := True; <br> &nbsp; &nbsp; Execute(sSql); <br> &nbsp; end; <br>end; <br><br>//Oracle-&gt;TXT <br>procedure TForm1.Button7Click(Sender: TObject); <br>begin <br> sSql := 'select VGH,VXM,VMM into lsygb.txt from (select * from lsygb in [ODBC][ODBC;Driver={Microsoft ODBC for Oracle};UID=BKLS;PWD=BKLS;SERVER=BKLS;])'; <br>// &nbsp;sSql := <br>// &nbsp; &nbsp;'select * into form.txt from ouform in [ODBC][ODBC;Driver={Microsoft ODBC for Oracle};UID=bklskf;PWD=bklskf;SERVER=bkls;]'; <br> with TxtConnection do <br> &nbsp; begin <br> &nbsp; &nbsp; Close; <br> &nbsp; &nbsp; Connected := True; <br> &nbsp; &nbsp; Execute(sSql); <br> &nbsp; end; <br>end; <br><br>//Oracle-&gt;Excel <br>procedure TForm1.Button8Click(Sender: TObject); <br>begin <br> sSql := <br> &nbsp; 'select * into aaa from lsygb in [ODBC][ODBC;Driver={Microsoft ODBC for Oracle};UID=bkls;PWD=bkls;SERVER=bkls;]'; <br> with ExcelConnection do <br> &nbsp; begin <br> &nbsp; &nbsp; Connected := True; <br> &nbsp; &nbsp; Execute(sSql); <br> &nbsp; end; <br>end; <br><br>//Oracle-&gt;DBF <br>procedure TForm1.Button11Click(Sender: TObject); <br>begin <br> sSql := <br> &nbsp; 'select * into aaa from lsygb in [ODBC][ODBC;Driver={Microsoft ODBC for Oracle};UID=bkls;PWD=bkls;SERVER=bkls;]'; <br> with DBFConnection do <br> &nbsp; begin <br> &nbsp; &nbsp; Connected := True; <br> &nbsp; &nbsp; Execute(sSql); <br> &nbsp; end; <br>end; <br><br>//TXT-&gt;Oracle <br>//Oracle数据库注意要将表名大写!不然创建出来的表可以看到表名但无法打开 <br>procedure TForm1.Button12Click(Sender: TObject); <br>begin <br> sSql := 'select * into PH_TXT in [ODBC][ODBC;Driver={Microsoft ODBC for Oracle};UID=bkls;PWD=bkls;SERVER=bkls;] from ph_txt.txt'; <br> with TxtConnection do <br> &nbsp; begin <br> &nbsp; &nbsp; Close; <br> &nbsp; &nbsp; Connected := True; <br> &nbsp; &nbsp; Execute(sSql); <br> &nbsp; end; <br>end; <br><br>//DBF-&gt;Oracle <br>procedure TForm1.Button13Click(Sender: TObject); <br>begin <br> sSql := <br> &nbsp; 'select * into PH_DBF in [ODBC][ODBC;Driver={Microsoft ODBC for Oracle};UID=bkls;PWD=bkls;SERVER=bkls;] from aaa'; <br> with DBFConnection do <br> &nbsp; begin <br> &nbsp; &nbsp; Connected := True; <br> &nbsp; &nbsp; Execute(sSql); <br> &nbsp; end; <br>end; <br><br>//Access-&gt;Oracle <br>procedure TForm1.Button14Click(Sender: TObject); <br>begin <br> sSql := <br> &nbsp; 'select * into PH_ACCESS in [ODBC][ODBC;Driver={Microsoft ODBC for Oracle};UID=bkls;PWD=bkls;SERVER=bkls;] from aaa'; <br> with AccessConnection do <br> &nbsp; begin <br> &nbsp; &nbsp; Connected := True; <br> &nbsp; &nbsp; Execute(sSql); <br> &nbsp; end; <br>end; <br><br>//Excel-&gt;Oracle <br>procedure TForm1.Button15Click(Sender: TObject); <br>begin <br>// &nbsp;'select * into MLB in [ODBC][ODBC;Driver={Microsoft ODBC for Oracle};UID=BKLS;PWD=BKLS;Server=BKLS;] from MLB' <br>//Provider=Microsoft.Jet.OLEDB.4.0;Data Source=f:/aaa.xls;Extended Properties=Excel 8.0;Persist Security Info=False <br> sSql := <br> &nbsp; 'select * into PH_EXCEL in [ODBC][ODBC;Driver={Microsoft ODBC for Oracle};UID=bkls;PWD=bkls;SERVER=bkls;] from aaa'; <br> with ExcelConnection do <br> &nbsp; begin <br> &nbsp; &nbsp; Connected := True; <br> &nbsp; &nbsp; Execute(sSql); <br> &nbsp; end; <br>end; <br><br>procedure TForm1.Button16Click(Sender: TObject); <br>begin <br> sSql := 'select * into qxb in ''f:/'' ''dbase 5.0;'' from lsqxb.txt'; <br> with TXTConnection do <br> &nbsp; begin <br>// &nbsp; &nbsp; &nbsp;Close; <br>// &nbsp; &nbsp; &nbsp;ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;Password=&quot;&quot;;Data Source=f:/temp;Extended Properties=&quot;text;HDR=YES;FMT=Delimited&quot;;Persist Security Info=True'; <br> &nbsp; &nbsp; Connected := True; <br> &nbsp; &nbsp; Execute(sSql); <br> &nbsp; end; <br>end; <br><br>end. <br><br> <br>来自: feelfly, 时间: 2003-12-19 10:58:00, ID: 2364187 &nbsp;<br>急问请问如何从sqlserver像这样导入MYSQL?MYSQL只有insert into ..select可以吗? <br>在线等,谢谢 &nbsp; <br> <br>来自: zyjsjwl, 时间: 2003-12-19 12:16:00, ID: 2364475 &nbsp;<br>如何将VFP 6.0的表导入SQL SERVER 2000? <br>怎么总提示有程序以独占方式打开该表 <br> <br>来自: fanronghua, 时间: 2003-12-19 12:22:00, ID: 2364481 &nbsp;<br>你们说要SQL SERVER 2000,我没有,我只有access2000,excel,delphi6,怎么把excel导入到access表里去啊,要不要创建表,我想要字段对应 <br>如:(access)gz-------工资(excel) <br><br> <br>来自: jiaojh, 时间: 2003-12-23 10:32:00, ID: 2370786 &nbsp;<br>以上的问题都是解决 ADO 的方法, <br> 有没有可以保存 SocketConnection1 中查询的数据的方法? <br>Clientdatabaset 是通过DCOMConnection 从服务器端查询到的数据, TABLE 是指向 本地磁盘中绝对路径的DBF表,如何将Clientdatabaset连接到 SocketConnection1中数据保存到本地 TABLE 中. <br><br> <br>来自: jiaojh, 时间: 2003-12-23 10:34:00, ID: 2370799 &nbsp;<br>想收到 EMAIL .所以在发一次. <br> <br>来自: Wizard00, 时间: 2003-12-23 16:29:00, ID: 2372017 &nbsp;<br>收藏,感动! <br> <br>来自: siow, 时间: 2003-12-24 14:42:00, ID: 2373917 &nbsp;<br>收藏 <br> <br>来自: wuchi, 时间: 2003-12-24 17:14:00, ID: 2374387 &nbsp;<br>请教,照着各位大侠的方法操作了一遍,还是不行。把一个MSSQL的数据库表及数据导出到excel中,提示:“ODBC--连接到‘SQL Server (Lacal)’失败”。是什么问题呢? <br><br>DataModule1.ADOConnection2.ConnectionString:= <br> 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=e:/car/导出数据/表格.xls;' <br> +'Extended Properties=excel 8.0;Persist Security Info=False'; <br>//表格.xls是已经建立好的excel文件 <br>DataModule1.ADOConnection2.Execute('select * into a from table IN [ODBC] [ODBC;Driver=SQL Server;UID=admin;PWD=;Server=(lacal);DataBase=car;]'); <br>//a为excel中的表名,table为MSSQL里的表, car是数据库名称 <br> <br>来自: WoDing, 时间: 2003-12-24 20:52:00, ID: 2374692 &nbsp;<br>建议哪位大侠写一个笔记,会更系统更完整! <br> <br>来自: jack_4826, 时间: 2003-12-26 5:13:00, ID: 2375923 &nbsp;<br>mark! <br> <br>来自: delphi_bbs_lwq, 时间: 2003-12-26 7:42:00, ID: 2375961 &nbsp;<br>我照着各位大侠的方法操作了一遍,还是不行! <br>在access to oracle 中用到以下的代码出错: <br>( odbc 连接到{microsoft odbc for oracle } tosun 失败 ) <br>(用ado的AccessConnection 连接access ,bb为access的一个表,st为oracle的一个表 ) <br>var <br>ssql:string ; <br>begin <br>sSql :='select * into st &nbsp;in [ODBC][ODBC;Driver={Microsoft ODBC for Oracle } ; ' + <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;' UID=zhiguan;PWD=zhiguan;SERVER=tosun ;] from bb'; <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;with AccessConnection do <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;begin <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Connected := True; <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Execute(sSql); <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end; <br> <br>来自: jiaojh, 时间: 2003-12-27 14:24:00, ID: 2378859 &nbsp;<br>有没有高手在回答了? <br>SocketConnection1 和 Clientdatabaset 连接的数据保存问题? <br> <br>来自: 吉祥雨, 时间: 2003-12-29 11:33:00, ID: 2381245 &nbsp;<br>诚恳请教: <br>我不会用AdoConnection,现在用query想实现从本地数据库导入到Oracle中, <br>共有20多个表,用什么方法呢? <br>如果是从Oracle--&gt;Oracle,又如何实现呢? <br>希望能够提供代码?谢谢! <br> <br>来自: skywin, 时间: 2003-12-29 11:42:00, ID: 2381264 &nbsp;<br>我顶先! <br> <br>来自: chenbin, 时间: 2003-12-29 17:20:00, ID: 2382233 &nbsp;<br>妤间富甯?府鎴戯紒 <br>SQL--&gt;DBF, <br><br>insert into OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', <br> 'Data Source=&quot;d:/&quot;;User ID=Admin;Password=;Extended properties=dBase 5.0')...usersq select * from ckusers <br><br>DELETE &nbsp;OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', <br> 'Data Source=&quot;d:/&quot;;User ID=Admin;Password=;Extended properties=dBase 5.0')...users <br>鍙?互鎴愬姛鎵ц?! <br>闂??锛? <br>1. 濡備綍鐪熸?鍒犻櫎DBF璁板綍! <br>2. 鎴戝?浣曠敤SQL璇?彞杩愯?璞?SELECT INTO&quot;銆?鐨勫姛鑳斤紝璁╁畠鍙?互鏂板缓涓?涓狣BF鏂囦欢鍛?紵 <br><br><br> <br>来自: jackchin, 时间: 2003-12-30 8:30:00, ID: 2382835 &nbsp;<br>OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', <br> 'Data Source=&quot;e:/share&quot;;User ID=Admin;Password=;Extended properties=dBase 3.0')...bmk <br>这行中,OpenDataSource的语法不甚明了,Books Online也没提到 <br>第1个参数还有没有其他可选的? <br>另外,最后...bmk应该是表名,就是.dbf的文件名,可是文件名要是汉字就不行 <br> <br>来自: fanronghua, 时间: 2003-12-30 8:41:00, ID: 2382856 &nbsp;<br>AdoConnection1.ConnectionString:= <br>'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:/book1.xls;' <br>+'Extended Properties=excel 8.0;Persist Security Info=False'; <br>AdoConnection1.Open; <br>AdoConnection1.Execute('SELECT * into abc &nbsp;from [c:/db1.MDB].abc'); <br><br>我想把excel导入access,报”外部表不是预期的格式“ 是什么原因? <br>还有,我把text导入access,他们字段和字段之间是用什么区别的? <br>在导入的时候可以设置字段的属性吗? <br>高手请回答! <br> <br>来自: microding, 时间: 2003-12-30 17:04:00, ID: 2384302 &nbsp;<br>我想问一下大家没有用上述方法来处理实现应用。我在用上述方法是遇到一个头痛的问题,不知各位是否有遇到,又是如何处理的。 <br>问题如下; <br> 环境:MSSQL2000 +OFFICE2000 &nbsp; <br> 作业; 把把.xls 文件导入MSSQL2000 <br> 现象:导入能成功,问题是导入的如果是字符串,结果导入后数据类型全为char(255),如果导入是数据类型,结果导入后数据类型全float,这样就无直接插入其他表中,总是提示'将截断字符串或二进制数据。将截断字符串或二进制数据。语句已终止。' <br><br> <br>来自: athene, 时间: 2004-01-04 17:43:00, ID: 2392333 &nbsp;<br>如何动态打开任一个DBF文件(包括,dbase,foxpro版本的)将其输出到word中,因为foxpro及dbase及vb的报表输出太差了。我去了许多网站,都找不到答案。最好给一个通用的模块。 <br> <br>来自: 小虫~, 时间: 2004-01-08 21:08:00, ID: 2401269 &nbsp;<br>to athene: <br> 鍝?噷鏈夎繖绉嶆ā鍧楀晩锛屽懙鍛碉紒 <br> 棣栧厛鏁版嵁搴撴槸浣犺嚜宸辨潵缁存姢鐨勶紝鍙栧緱闇?瑕佺殑鏁版嵁浠ュ悗鍦ㄩ?氳繃ole鍙?互杩炴帴鍜屾帶鍒秝ord锛屽皢鏁版嵁杈撳叆鍒皐ord. <br> 鍙︼紝杩欓噷璁ㄨ?鐨勯兘鏄痙elphi,鍑犱箮娌′汉浣跨敤fox,vb绛夛紒鐜板湪delphi鏈変笉灏戞帶浠跺仛鎶ヨ〃涔熶笉閿欑殑锛?C1=1 <br> <br>来自: huddle, 时间: 2004-01-14 14:10:00, ID: 2410687 &nbsp;<br>看了以上一些关于oracle数据库的例子,似乎都是用microsoft odbc连的 <br>有用其它方法比如ado连接oracle导数据成功的吗,我用odbc连oracle总觉得有点问题 <br> <br>来自: hs125, 时间: 2004-01-14 14:24:00, ID: 2410726 &nbsp;<br>提出一缺陷: <br>用该方法从源数据库添加数据到目的数据库,无法用事务控制。 <br> <br>来自: hs125, 时间: 2004-01-14 14:26:00, ID: 2410732 &nbsp;<br>想目的数据库添加数据时,能用事务控制吗? <br> <br>来自: ranyang, 时间: 2004-01-16 11:45:00, ID: 2414651 &nbsp;<br>佩服!好!不错!很棒! <br>帅呆了!酷逼乐!! <br> <br>来自: yjhzzgl, 时间: 2004-01-16 15:09:00, ID: 2415149 &nbsp;<br>好!!学习!!!! <br> <br>来自: cjf1009, 时间: 2004-01-31 20:33:00, ID: 2428998 &nbsp;<br> sql:='Select * Into [Text;Database='+fp+'].'+fn+' from carinfo where cardate&gt;='+adate1+' and cardate&lt;='+adate2+' and zhuitao=&quot;是&quot;'; <br> Tdmmain.ADOConn1.Execute(sql); <br>为什么我导出的记录是0条?而查询是两条的!就是时间这里的问题,把时间条件去了,就可以导出两条了。 <br> <br>来自: Tiger0920, 时间: 2004-02-01 16:13:00, ID: 2429944 &nbsp;<br> &nbsp; 各位大哥,小弟想把txt导入access,可是到如后所有字段不变成了以一个字段, <br> &nbsp; 不知如何使用,分隔符,望指点,多谢多谢!!!!!!!!!! <br> <br>来自: yulinsoft, 时间: 2004-02-03 10:45:00, ID: 2432992 &nbsp;<br>SELECT * FROM OpenDataSource('Microsoft.Jet.OLEDB.4.0','DataSource=&quot;F:/bbb.xls&quot;;Extended Properties=Excel 8.0')...[bbb$] <br>我在SQL查询器里面执行,报错:OLE DB provider 'Microsoft.Jet.OLEDB.4.0' does not contain table 'bbb$'. <br>请各位已经精通的朋友略微指点一下。我着急用...谢谢了 <br><br> <br>来自: lichao9903, 时间: 2004-02-03 16:45:00, ID: 2433950 &nbsp;<br>To yulinsoft <br>导入并新建表 <br>SELECT * into [创建的表名] FROM OpenDataSource('Microsoft.Jet.OLEDB.4.0','DataSource=&quot;F:/bbb.xls&quot;;Extended Properties=Excel 8.0')...[sheet1$]--&gt;这是工作表的名字 <br>导入已存在的表中 <br>insert into [表名] <br>SELECT * into [创建的表名] FROM OpenDataSource('Microsoft.Jet.OLEDB.4.0','DataSource=&quot;F:/bbb.xls&quot;;Extended Properties=Excel 8.0')...[sheet1$]--&gt;这是工作表的名字 <br><br> <br>来自: pyzfl, 时间: 2004-02-03 18:58:00, ID: 2434211 &nbsp;<br>收藏 <br> <br>来自: Rafe, 时间: 2004-02-03 20:14:00, ID: 2434318 &nbsp;<br>在导出前,怎么判断是否存在这个文件名呢? <br> <br>来自: xianguo, 时间: 2004-02-04 16:11:00, ID: 2435943 &nbsp;<br>我在SQLServer的查询分析器中执行: <br>SELECT * FROM OpenDataSource('Microsoft.Jet.OLEDB.4.0','Data Source=&quot;C:/Test.xls&quot;;Extended Properties=&quot;Excel 8.0;HDR=Yes;&quot;;Persist Security Info=False')...[sheet1$] <br>出现如下提示: <br>服务器: 消息 7415,级别 16,状态 1,行 1 <br>已拒绝对 OLE DB 提供程序 'Microsoft.Jet.OLEDB.4.0' 的特殊访问。必须通过链接服务器来访问此提供程序。 <br>为什么? <br> <br>来自: nclpf, 时间: 2004-02-08 19:19:00, ID: 2443341 &nbsp;<br>顶,谢谢了! <br> <br>来自: WoDing, 时间: 2004-02-08 19:36:00, ID: 2443369 &nbsp;<br>I up <br>我顶 <br>woding <br> <br>来自: kusanagi, 时间: 2004-02-08 22:43:00, ID: 2443655 &nbsp;<br>请大家考虑一下,如果数据文件和sql server不在一台计算机上该怎么写? <br> <br>来自: szkenpa, 时间: 2004-02-09 22:48:00, ID: 2444005 &nbsp;<br>hao <br> <br>来自: cdhua, 时间: 2004-02-16 19:57:46, ID: 2456363 &nbsp;<br>楼主access ---&gt; excel怎么做 <br>谢谢! <br> <br>来自: Justin Ren, 时间: 2004-02-16 20:24:29, ID: 2456383 &nbsp;<br>好 <br> <br>来自: lesxc, 时间: 2004-02-16 20:52:11, ID: 2456411 &nbsp;<br>非常感谢楼主。 <br>我用了楼主的方法帮我解决了批量的excle表转换成access表。再次谢过。 <br><br> <br>来自: cdhua, 时间: 2004-02-16 21:10:41, ID: 2456441 &nbsp;<br>有人能帮我吗 <br>access----&gt;excel 表格 <br> <br>来自: markss, 时间: 2004-02-23 1:31:52, ID: 2466963 &nbsp;<br>在DBF-&gt;SQL Server中,我使用下面的语句在SQL查询分析器中运行单个语句成功! <br>exec('insert &nbsp;table1 (col1,col2) select col1,col2 from OpenRowSet(''MSDASQL'',''dsn=import;SourceDB=C:/dbf/;SourceType=DBF'',''select * &nbsp;from C:/dbf/dbf1.dbf '')') <br><br>但是在实际中,由于需要批量导入多个不同的DBF <br>所以使用了procedure(pr_imp),在一个循环中动态改变dbf的名称 <br>exec pr_imp 'C:/dbf/' <br><br>这时候就出现错误提示: <br>服务器: 消息 7405,级别 16,状态 1,行 1 <br>异类查询要求为连接设置 ANSI_NULLS 和 ANSI_WARNINGS 选项。这将确保一致的查询语义。请启用这些选项,然后重新发出查询。 <br><br>那么应该如何设置上面的两个参数呢? <br>具体问题请看:http://www.delphibbs.com/delphibbs/dispq.asp?lid=2466769 <br><br>各位大侠救命阿!! <br> <br>来自: 小小雪, 时间: 2004-02-29 12:08:30, ID: 2476626 &nbsp;<br>请教各位高手:如何实现从txt更新access表? <br>txt文件有近30万条记录,固定长度分隔字段,access表以前几个字段为复合索引,根据access表的索引将txt文本文件内容更新或追加到access表。如:access表有下列字段 <br>网点号,账号,未笔日期,金额 <br>demo.txt文件内容为 <br>2001123456782004010100000100 <br>2001123456792004010100005100 <br>如第一笔2001为网点号 <br>12345678为账号 <br>20040101为未笔日期 <br>00000 100为金额 <br>access以“网点号,账号”为索引 <br>用BatchMove可以方便导入数据(加demo.ini)但速度有一点慢,同时要用到BDE, <br>如用(ADO) SQL如何实现,速度能否控制在4分钟以下? <br>请各位指点。 <br><br><br><br><br><br> <br>来自: 里斯, 时间: 2004-03-18 19:54:40, ID: 2509951 &nbsp;<br>高手请帮忙 <br>我从TXT导入SQL时数据不是我想要的[:(] <br>我的TXT文件中的数据如下,一般有2-3万条。 <br>2004030517500459015001 <br>2004030517500464580001 <br>2004030517460479451001 <br>[blue]导入语句 select * from OpenRowset('MSDASQL', 'Driver={Microsoft text Driver (*.txt; *.csv)}; <br>DefaultDir=c:/temp;','select &nbsp;* from aaa.txt')[/blue]结果变成了如下记录? <br>2.0040305175004591E+21 <br>2.0040305175004646E+21 <br>2.0040305174604795E+21 <br>各位高手帮忙怎么能使他不变? <br>多谢了。 <br> <br>来自: lilywild, 时间: 2004-03-21 15:39:25, ID: 2513758 &nbsp;<br>我也想实现DBF-----&gt;oracle <br>有谁帮我呀 <br> <br>来自: 19851213, 时间: 2004-03-22 21:52:17, ID: 2516250 &nbsp;<br>支持!感谢碧血剑,向你学习 <br> <br>来自: rena_pan, 时间: 2004-03-24 21:31:02, ID: 2520420 &nbsp;<br>我从Access to SQL Server 出现字段顺序与原来不同了,有什么方法使它与原来的保持一致? 谢谢! <br> <br>来自: chenjianyyzz, 时间: 2004-03-30 22:37:36, ID: 2530675 &nbsp;<br>我在BDE中配置FOXPRO数据源,原来的FORPRO是没有密码的, <br>但我设置TABLE.ACTIVE=TRUE时却弹出对话框叫我输入密码和账号,请问该怎么办啊? <br>麻烦情回复到chenjianyyzz@sohu.com,谢谢 <br> <br>来自: chenjianyyzz, 时间: 2004-03-30 23:22:45, ID: 2530728 &nbsp;<br>急:请问如何在delphi中连visual foxpro 3.0的数据库啊? <br>麻烦您顺便发一封信到chenjianyyzz@sohu.com <br>谢谢 <br><br> <br>来自: lilywild, 时间: 2004-03-31 0:04:46, ID: 2530746 &nbsp;<br>[red]to chenjianyyzz:[/red] <br>弹出对话框时,不用输入账号和密码,直接按确定就连接到dbf数据源。 <br> <br>来自: jingzi, 时间: 2004-04-01 16:49:16, ID: 2534041 &nbsp;<br>想向大家请教一个问题!我想在sql里面直接读出paradox7的表的内容,我的sql语句是这样写的: <br>SELECT * FROM OPENDATASOURCE ('Microsoft.Jet.OLEDB.4.0','Data Source=&quot;D:/NacuesCA/Fujian&quot;;User ID=Admin;Password=;Extended properties=paradox 7.x')...t_tdd <br>可是提示说ole/db provide returned message:无效的操作,请问这是什么错误,怎么解决呀? <br> <br>来自: syb1424, 时间: 2004-04-21 22:23:49, ID: 2573182 &nbsp;<br>我是个学生 &nbsp;我现在在做毕业设计,对DELPHI不是很熟 请教一个问题 <br>procedure Tfrm_huifu.SpeedButton1Click(Sender: TObject); <br>var <br> datapath:string; <br>begin <br> ADOConnection1.ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+getcurrentdir+'/password.mdb;Persist Security Info=False;'; <br> ADOConnection1.Connected:=True; <br> OpenDialog1.Filter := '恢复文件 (*.mdb)|*.mdb|所有文件 (*.*)|*.*'; <br> //设置备份文件后缀 <br> &nbsp;if OpenDialog1.Execute then <br> &nbsp; DataPath := OpenDialog1.FileName; <br> &nbsp; self.adoconnection1.Execute('select * into password from password in '''datapath''''); <br> &nbsp; showmessage('数据库文件恢复成功!'); <br>end; <br>这样为什么不行 &nbsp; &nbsp;datapath是变量 <br>我是想动态的去把备份PASSWORD数据库(ACCESS)导入到系统现有的PASSWORD数据库(ACCESS)中去? <br>谢谢大家帮我 <br> <br>来自: babyrun, 时间: 2004-04-23 8:59:41, ID: 2575894 &nbsp;<br>您的方法可否实现EXCEL表关联ACCESS数据库表中字段的问题?就是说我想把一个EXCEL表中的数据导到ACCESS中去,除此之外根据EXCEL中的某个字段关联ACCESS中某个表的字段,从而形成新的“表”导入到数据库中去? <br><br>EXCEL表 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ACCESS中表 <br>姓名 &nbsp; &nbsp;班级 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;班级 &nbsp; &nbsp;年级 <br>--------------------------------------- <br>导入导数据库中形成的表格式为: <br>姓名 &nbsp; &nbsp;班级 &nbsp; &nbsp;年级 <br> <br>来自: 小明儿, 时间: 2004-04-23 21:59:03, ID: 2577673 &nbsp;<br>不错啊!收藏 <br> <br>来自: huxiaobo, 时间: 2004-04-24 15:21:28, ID: 2578588 &nbsp;<br>TO:碧血剑 <br>SELECT * into <br>SQL_TableName <br>FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', 'Data Source=&quot;c:/&quot;;User ID=Admin;Password=;Extended properties=dBase 5.0')...DBF_TableName <br>OLE DB 提供程序 'Microsoft.Jet.OLEDB.4.0' 不包含表 'DBF_TableName'。该表可能不存在,或当前用户没有使用该表的权限。 <br><br>请问为什么,非常着急,谢谢回答!!! <br>谢谢! <br> <br>来自: huxiaobo, 时间: 2004-04-24 15:48:02, ID: 2578639 &nbsp;<br>[red]help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!![/red] <br>我把DBF_TableName.dbf文件拷贝到服务器上了,原来是在本地执行的,所以这样的错误,现在我在服务器上执行,出现了新的错误,请帮忙!谢谢 <br><br><br>OLE DB 提供程序 'Microsoft.Jet.OLEDB.4.0' 报错。 <br>[OLE/DB provider returned message: Microsoft Jet 数据库引擎找不到对象'DerateMoney'。请确定对象是否存在,并正确地写出它的名称和路径。] <br><br> <br>来自: tang67, 时间: 2004-04-24 19:37:42, ID: 2578909 &nbsp;<br>支持!感谢碧血剑,向你学习 <br> <br>来自: chenjianzu, 时间: 2004-04-27 17:43:30, ID: 2584183 &nbsp;<br>好贴,顶! <br> <br>来自: xml1123, 时间: 2004-04-28 11:43:31, ID: 2585392 &nbsp;<br>to syb1424, <br>self.adoconnection1.Execute('select * into password from password in '''datapath''''); <br>改为 <br>self.adoconnection1.Execute('select * into password from password in '''+datapath+''''); <br><br><br> <br>来自: zhuxi168, 时间: 2004-04-28 11:47:42, ID: 2585401 &nbsp;<br>看我的网站吧! <br>我网站里面有这个东东的源程序。 <br>http://BetterMicrosoft.icpcn.com <br><br> <br>来自: professorzhou, 时间: 2004-04-28 23:09:15, ID: 2586648 &nbsp;<br>对access表得操作,从excel导入到access,成功 <br>try <br> &nbsp; if self.OpenDialog1.Execute then <br> &nbsp; &nbsp; tmpdir := ExtractFilePath(self.OpenDialog1.FileName) + ExtractFileName(self.OpenDialog1.FileName); <br> &nbsp; self.Caption := tmpdir; <br> &nbsp; self.ADOConnection1.Connected:=true; <br> &nbsp; self.ADOConnection1.Execute('insert into &nbsp;aa(sid,sname,cname) select sid,sname,cname from [excel 8.0;database=' + tmpdir + '].[Sheet1$]'); <br> &nbsp;// self.ADOQuery1.Active := false; <br> &nbsp;//self.ADOQuery1.SQL.Clear; <br> &nbsp;// self.ADOQuery1.SQL.Add('select * into aa from [excel 8.0;database=' + tmpdir + '].[Sheet1$]'); <br> &nbsp;// self.ADOQuery1.Open; <br> except <br> &nbsp; showmessage('fail'); <br> end; <br> <br>来自: sqler, 时间: 2004-05-01 17:32:09, ID: 2591148 &nbsp;<br>SELECT * into bmk <br>FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', <br> 'Data Source=&quot;e:/share&quot;;User ID=Admin;Password=;Extended properties=dBase 5.0')...bmk <br><br>但是我用就报错说: <br>OLE DB 提供程序 'Microsoft.Jet.OLEDB.4.0' 报错。 <br>[OLE/DB provider returned message: 外部表不是预期的格式。] <br>急啊,请高手赐教 <br><br> <br>来自: yuejun, 时间: 2004-05-10 11:43:19, ID: 2602026 &nbsp;<br>====================== &nbsp;ORACLE -&gt; ACCESS &nbsp;不成功============================= <br>Driver={Microsoft ODBC for ORACLE} &nbsp;用这个根本无法连接ORACLE, <br>我的机器装了ORACLE 9i , 所以我用 Driver = Oracle in OraHome92; <br>数据在ORACLE服务器192.168.2.190上, 数据源 orcl190 ;ACCESS 在本地机器上 <br>,以下是我的源码: <br>AD为TADOConnection,事先链接好ACCESS库,ACCESS的链接如下: <br>Provider=Microsoft.Jet.OLEDB.4.0;Password=&quot;&quot;;Data Source=D:/app/local.mdb;Persist Security Info=True' <br>执行: <br> ad.Execute('select * into BK_STORY_TYPE from STORY in [ODBC][ODBC;Driver=Oracle in OraHome92;UID=czh;PWD=cc;SERVER=192.168.2.190;Database=orcl190]'); <br><br>但是提示说 &quot;Microsoft.Jet.OLEDB.4.0 找不到 STORY 表,或表是否存在&quot;,STORY表是属于ORACLE库的, 在这个表是有的, 我感觉跟我用的ODBC DRIVER 有关, 因为楼上所有成功执行ORACLE-&gt;ACCESS的案例,都是用{Microsoft ODBC for ORACLE} 的驱动, 不是用ORACLE自已的 <br> <br>来自: vvvguo, 时间: 2004-05-10 14:52:44, ID: 2602473 &nbsp;<br>oracle to access 是成功的,反过来是不成功的,目前还没有找到解决的办法 <br> <br>来自: wmyu, 时间: 2004-05-10 15:06:29, ID: 2602506 &nbsp;<br>好! <br> <br>来自: c.lu, 时间: 2004-05-13 11:07:41, ID: 2607538 &nbsp;<br>太好啦 <br><br> <br>来自: vfphome, 时间: 2004-05-14 17:10:35, ID: 2610609 &nbsp;<br>精彩啊,收藏 <br> <br>来自: zzysky, 时间: 2004-05-14 17:16:33, ID: 2610630 &nbsp;<br>放着DTS不用干什么呀? <br>Select into 效率太低! <br> <br>来自: 刘麻子, 时间: 2004-05-14 17:28:20, ID: 2610685 &nbsp;<br>谢谢 , 收藏 + 听课 <br> <br>来自: XLPFX, 时间: 2004-05-28 11:14:24, ID: 2632379 &nbsp;<br>这个问题能回答吗? <br>
代码:
http://www.delphibbs.com/delphibbs/DispQ.asp?LID=2631390 <br> <br>来自: XLPFX, 时间: 2004-05-28 11:16:05, ID: 2632394 &nbsp;<br>一个ORACLE导出到DBF文件的问题,不管用什么方法,只要能够实现(经本人验证合格),高分相送! <br>
代码:
http://www.delphibbs.com/delphibbs/DispQ.asp?LID=2631390 <br> <br>来自: compard, 时间: 2004-05-28 11:22:58, ID: 2632414 &nbsp;<br>very good! <br> <br>来自: XLPFX, 时间: 2004-05-28 16:16:31, ID: 2633059 &nbsp;<br>ACCESS导出到TXT格式如下: <br>oConn.Execute &quot;SELECT * INTO [Text;DATABASE=C:/].[path.TXT] FROM [systemuser]&quot; <br>我怎么会出现错误“找不到插入对象ISAM”这是为什么呢?请指教! <br> <br>来自: XLPFX, 时间: 2004-05-28 17:33:34, ID: 2633212 &nbsp;<br>实现导入导出时,是不是还要引入工程什么的呀,应该引入什么工作呢? <br><br>因为,书上的例子能够运行成功,但我自己写之后,却不能成功,出现的错误就像上面一样! <br><br>请问,应该怎么实现? <br> <br>来自: XLPFX, 时间: 2004-05-28 18:09:15, ID: 2633279 &nbsp;<br>以下语句是在ORACLE 的 SQL*PLUS 工作单中执行,我不知道它出错的地点是什么,请问应该怎么写才不会出错;其中,GADATA0003是数据库,EMPLOYEE是表 <br>SELECT * INTO [dBase III;DATABASE=C:/].[path.DBF] FROM gadata0003.employee <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * <br>ERROR 位于第 1 行: <br>ORA-00905: 缺少关键字 <br><br>另一种方式:INSERT INTO 也会出错, <br><br>insert INTO [dBase III;DATABASE=C:/].[path.DBF] SELECT * FROM gadata0003.employee <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * <br>ERROR 位于第 1 行: <br>ORA-00903: 无效表名 <br><br>请问为什么,应该怎么写才不会出错!急急急急急急急急急急急急急急急急急急!!!! <br> <br>来自: 阳光游子, 时间: 2004-05-28 21:09:16, ID: 2633554 &nbsp;<br>好东西,收藏 <br> <br>来自: zwz_good, 时间: 2004-05-29 10:15:36, ID: 2634098 &nbsp;<br>留用 <br> <br>来自: thenthen, 时间: 2004-06-02 20:25:58, ID: 2642185 &nbsp;<br>我用sql 导出 excel <br>DataModule1.ADOConnection1.Connected:=false; <br>DataModule1.ADOConnection1.ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source=e:/a.xls;Extended Properties=EXCEL 8.0;Persist Security Info=False'; <br>DataModule1.ADOConnection1.Connected:=true ; <br>出现error '未设定只读属性值'这是怎么回事啊 大虾救我啊 <br> <br>来自: fodou, 时间: 2004-06-07 9:15:53, ID: 2649489 &nbsp;<br>我從excel取數,報錯 <br>伺服器: 訊息 7399,層級 16,狀態 1,行 1 <br>OLE DB Provider 'microsoft.jet.oledb.4.0' 報告了錯誤。 <br>[OLE/DB provider returned message: 找不到可安裝的 ISAM。] <br> <br>来自: peirenlei, 时间: 2004-06-09 14:43:08, ID: 2654001 &nbsp;<br>太好了,这种方法即快又简单,妙妙 <br> <br>来自: ocxlhy, 时间: 2004-06-17 11:07:01, ID: 2667766 &nbsp;<br>谢谢!!!我帮顶一下! <br> <br>来自: wjs, 时间: 2004-06-20 7:46:23, ID: 2672581 &nbsp;<br>procedure TFormMain.mnuExportDataDBFClick(Sender: TObject); <br>var <br> sql: string; <br> ADOConnection1: TADOConnection; <br> pathname: string; <br>begin <br> SaveDialog1.DefaultExt := '.DBF'; <br> SaveDialog1.FileName &nbsp; := 'WORK1.DBF'; <br> SaveDialog1.Title &nbsp; &nbsp; &nbsp;:= '导出DBASE 数据库文件'; <br> SaveDialog1.Filter &nbsp; &nbsp; := 'DBASE 数据库|*.DBF'; <br><br> if not SaveDialog1.Execute then exit; <br><br> pathname := ExtractFilePath(SaveDialog1.FileName); <br> ADOConnection1 := TADOConnection.Create(self); <br> ADOConnection1.LoginPrompt := false; <br> ADOConnection1.ConnectionString := <br> &nbsp; &nbsp;'Provider=MSDASQL.1;' + <br> &nbsp; &nbsp;'Persist Security Info=False;' + <br> &nbsp; &nbsp;'Extended Properties=' + <br> &nbsp; &nbsp;'&quot;Driver={Microsoft Visual FoxPro Driver};' + <br> &nbsp; &nbsp;'UID=;' + <br> &nbsp; &nbsp;'SourceDB='+ pathname + <br> &nbsp; &nbsp;';SourceType=DBF;' + <br> &nbsp; &nbsp;'Exclusive=No;' + <br> &nbsp; &nbsp;'BackgroundFetch=Yes;' + <br> &nbsp; &nbsp;'Collate=Machine;' + <br> &nbsp; &nbsp;'Null=Yes;' + <br> &nbsp; &nbsp;'Deleted=Yes;&quot;'; <br><br> try <br> &nbsp; ADOConnection1.Connected := true; <br><br> &nbsp; pathname := ExtractFileName(SaveDialog1.FileName); <br> &nbsp; sql := 'selectt * into ' + pathname + ' ' + <br> &nbsp; &nbsp; 'FROM ' + myJob.DataTable_1 + ' ' + <br> &nbsp; &nbsp; 'IN [ODBC] [ODBC;Driver=SQL Server;' + <br> &nbsp; &nbsp; 'UID=sa;' + <br> &nbsp; &nbsp; 'PWD=' + myDatabase.SAPSW + ';' + <br> &nbsp; &nbsp; 'Server=' + myDatabase.Server + ';' + <br> &nbsp; &nbsp; 'DataBase=' + myDatabase.Database + ';]'; <br><br> &nbsp; &nbsp; ADOConnection1.Execute(sql); <br> finally <br> &nbsp; ADOConnection1.Free; <br> end; <br><br>上面程序 运行 出错([Microsoft][obdc visual foxpro driver ]unrecognized verb 不可识别的命令动词),无法导出 dbf ,请个位大侠指点 <br> <br>来自: VGA, 时间: 2004-06-20 16:02:18, ID: 2673019 &nbsp;<br>sql := 'selectt * into ' + pathname + ' ' + <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^^ <br>两个 t, 的确不可识别 <br> <br>来自: wjs, 时间: 2004-06-21 9:20:28, ID: 2673388 &nbsp;<br>一般是在ACCESS或是SQLSERVER中查寻,或是汇总,然后生成一个‘记录集’可以显示在GRID里,也可以将这个记录集导出到磁盘中。   <br><br>  下面可以导出Xls,DBF,DB,MDB(表),这些功能是由ISAM数据库接口实现,为了导出各种版本的文件,我在MS网站下载了最新的JET4和MDAC6。前者到用于桌面数据库如ACCESS,FOXPRO的组件,后者是实现新版本ADO组件。分别在: <br><br>  http://download.microsoft.com/download/access2000/SP/4.0/NT5/EN-US/Jet40SP5_W2K.exe <br>  http://download.microsoft.com/download/dasdk/install/2.60.6526.3/WIN98Me/CN/mdac_typ.exe <br><br>  这些是标准的SQL导出语句: <br><br>  select * into [Excel 8.0;database=导出目录].导出表名 from 表 <br><br>  select * into [FoxPro 2.6;database=导出目录].导出表名 from 表 <br><br>  select * into [FoxPro 2.5;database=同上].导出表名 from 表 <br><br>  select * into [dBase III;database=同上].导出表名 from 表 <br><br>  select * into [Paradox 4.X;database=同上].导出表名 from 表 <br><br>  select * into [;database=C:/temp/xxx.mdb].导出表名 from 表 <br><br>我要从 sql2000 -&gt; dbf, 为什么上面的方法不灵呀? <br><br>出错的情况 和 斗士兄 说的一样, “ 导出据库 不存在” <br> <br>来自: longxin21, 时间: 2004-06-28 17:28:33, ID: 2685301 &nbsp;<br>wjs 找的jet4的很有用的,98下需要更新的说[:D]支持[:D] <br> <br>来自: lijianfeng, 时间: 2004-07-04 13:46:57, ID: 2695042 &nbsp;<br>procedure TForm1.BitBtn1Click(Sender: TObject); <br>begin <br>with query1 do <br>begin <br>Close; <br>SQL.Clear; <br>SQL.Add('SELECT * &nbsp;FROM OpenDataSource('+'''' <br> &nbsp; &nbsp; &nbsp; +'Microsoft.Jet.OLEDB.4.0'+''','+'''' <br> &nbsp; &nbsp; &nbsp; +'Data Source=''''C:/sapdump/0531summary.xls'''';User ID=Admin;Password=;Extended properties=Excel 5.0'+''')'+'...[userlist$]'); <br>try <br> &nbsp;ExecSQL; <br>except <br> &nbsp;open; <br>end; <br>end; <br><br>end; <br><br>不行呀,出现这样的错误,我都搞了很多次了 <br>heterogeneous queries require the ANSI_NULLS and ANSI_WARNIN <br>S options to be set for the connection this ensures consistens <br><br><br> <br>来自: Tengxing, 时间: 2004-07-05 23:18:12, ID: 2697739 &nbsp;<br>收藏了 <br> <br>来自: 逻辑鱼, 时间: 2004-07-07 9:24:56, ID: 2699745 &nbsp;<br>不知道还有没有人关注了 <br>我花了很长时间看大家发过的帖子 <br>但是发现一个问题 <br>就是从Oracle to dbf 的时候 <br>如果我服务器是Oracle 即用oracle的connection好像由于 <br>sql不自持select * into 可能这个方法就不好 <br>我想知道在 Oracle的 sqlplus里 怎么写 <br> <br>来自: 逻辑鱼, 时间: 2004-07-07 9:33:30, ID: 2699763 &nbsp;<br>以下语句是在ORACLE 的 SQL*PLUS 工作单中执行,我不知道它出错的地点是什么,请问应该怎么写才不会出错;其中,GADATA0003是数据库,EMPLOYEE是表 <br>SELECT * INTO [dBase III;DATABASE=C:/].[path.DBF] FROM gadata0003.employee <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * <br>ERROR 位于第 1 行: <br>ORA-00905: 缺少关键字 <br><br>另一种方式:INSERT INTO 也会出错, <br><br>insert INTO [dBase III;DATABASE=C:/].[path.DBF] SELECT * FROM gadata0003.employee <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * <br>ERROR 位于第 1 行: <br>ORA-00903: 无效表名 <br><br><br>我也遇到相同问题 <br> <br>来自: zhuxd, 时间: 2004-07-08 20:08:18, ID: 2703127 &nbsp;<br>使用ADOConnection1.Execute方法导入导出数据时怎么显示进度信息 <br> <br>来自: hjc_2004, 时间: 2004-07-19 9:22:04, ID: 2718554 &nbsp;<br>sqlserver 如何连接dbf用什么连 <br>...bmk到底省略了什么 <br> <br>来自: starblue, 时间: 2004-07-19 9:29:33, ID: 2718577 &nbsp;<br>碧先生: <br>我用你的,ADOConnection.Connected := True; <br>ADOConnection.Execute('Select * Into abcd From Text;Database=c:/temp].aaaa.txt') <br>這一方法,還是不行,提示無法寫數據. <br> <br>来自: pgjeffrey, 时间: 2004-07-19 9:56:06, ID: 2718619 &nbsp;<br>超好,顶!! <br> <br>来自: uiit, 时间: 2004-07-19 10:05:43, ID: 2718644 &nbsp;<br>现在怎么没有这种人了 <br>哎 <br>从事这个职业太晚了 <br> <br>来自: hongxing_dl, 时间: 2004-07-21 18:07:36, ID: 2723215 &nbsp;<br>&gt;&gt;碧血剑: <br>能不能说说Oracle的例子?????? <br>导入Oracle或者由Oracle导出到其他数据库???????????? <br> <br>来自: sncel, 时间: 2004-07-22 17:52:32, ID: 2725167 &nbsp;<br>所有操作在MSSQL2000下进行。 <br><br>//查询多个MSSQL数据库服务器中的数据 <br>SELECT &nbsp;a.au_id,b.au_lname <br>FROM OPENROWSET('SQLOLEDB','xyly/tbird';'sa';'', <br> &nbsp;'select * from pubs.dbo.authors') AS a, <br>OPENROWSET('SQLOLEDB','.';'sa';'sncel', <br> &nbsp;'select * from pubs.dbo.authors') AS b <br>where a.au_id=b.au_id <br><br>//查询Access数据库 <br>SELECT &nbsp;a.* FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','c:/LogicTemp.mdb';'admin';'', localsereiesinfo) A &nbsp; &nbsp; <br><br><br>//SQL SERVER <br>SELECT a.* FROM OPENROWSET('MSDASQL','DRIVER={SQL Server};SERVER=xyly/tbird;UID=sa;PWD=',pubs.dbo.authors) AS a <br>ORDER BY a.au_lname, a.au_fname <br><br>//查询Oracle <br>SELECT a.* FROM OPENROWSET('MSDAORA','hzxj';'tb_power_system';'tbird','select * from ml_scrits') AS a <br><br>//Link Server <br>SELECT a.au_id,b.au_lname FROM OPENQUERY(testlink, 'SELECT * from pubs.dbo.authors') A,pubs.dbo.authors b <br>where b.au_id=a.au_id <br><br> <br>来自: sncel, 时间: 2004-07-22 17:54:12, ID: 2725172 &nbsp;<br>insert into NameList ([学号],[姓名]) <br>SELECT <br>[学号], <br>[姓名] <br><br>FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', <br> 'Data Source=&quot;c:/NameList.xls&quot;;User ID=Admin;Password=;Extended properties=Excel 5.0')...fg$ <br> <br>来自: wmqiong, 时间: 2004-07-23 9:32:12, ID: 2725955 &nbsp;<br>当用insert into tablename from opendatasource(....) 这种形式从EXCEL导入数据到SQL SERVER中时,如果字段多于2个,就难以控制EXCEL字段的排列顺序,从而导致导入不成功,有什么方法控制字段的顺序吗 <br><br> <br>来自: gz_ggd, 时间: 2004-07-26 16:18:43, ID: 2731406 &nbsp;<br>碧先生: <br>看了这么多大侠的文章,可是我将文本文件导入到foxpro这一步都没有做出来,请问怎样做才好? <br> <br>来自: fansihong, 时间: 2004-07-28 22:21:05, ID: 2735911 &nbsp;<br>不错 &nbsp;不错 <br> <br>来自: bhg007, 时间: 2004-07-29 15:34:26, ID: 2737253 &nbsp;<br>to 碧血剑:精彩!实在是高! <br> <br>来自: lingyun2003, 时间: 2004-07-30 10:10:12, ID: 2738554 &nbsp;<br>楼主 ,向你致谢! <br> <br>来自: friendship, 时间: 2004-08-03 11:20:42, ID: 2745692 &nbsp;<br>请问:碧血剑 <br>str1:='''Microsoft.Jet.OLEDB.4.0'',''Data Source=&quot;c:/电工数字化管理/mat.xls&quot;;User ID=Admin;Password=; Extended properties=&quot;Excel 8.0&quot;;'''; <br>strsql:= 'SELECT into 物料清单 &nbsp;FROM OpenDataSource('+str1+')...Sheet1$'; <br>MessageDlg(strsql, mtinformation,[mbok], 0); <br>Rec1.open(strsql,Conn1,3,3,0001); <br>rec1.close; <br>总是报错,说什么没权限之类的,我实际的该用户的权限没问题啊 <br> <br>来自: friendship, 时间: 2004-08-03 11:27:40, ID: 2745732 &nbsp;<br>请问:碧血剑 <br>str1:='''Microsoft.Jet.OLEDB.4.0'',''Data Source=&quot;c:/电工数字化管理/mat.xls&quot;;User ID=Admin;Password=; Extended properties=&quot;Excel 8.0&quot;;'''; <br>strsql:= 'SELECT * into 物料清单 &nbsp;FROM OpenDataSource('+str1+')...Sheet1$'; <br>MessageDlg(strsql, mtinformation,[mbok], 0); <br>Rec1.open(strsql,Conn1,3,3,0001); <br>rec1.close; <br>总是报错,说什么没权限之类的,我实际的该用户的权限没问题啊 <br>提示拒绝OLE &nbsp;DB 的访问,必须通过链接服务器来访问,为什么,请指教! <br> <br>来自: lndzh, 时间: 2004-08-05 9:33:46, ID: 2749278 &nbsp;<br>请问:碧血剑 <br>下面的asp页面中要实现SQL server数据库导出到Access,sql语句在查询设计器中执行正常,但在ASP中却提示 <br>Microsoft OLE DB Provider for ODBC Drivers (0x80004005) <br>[Microsoft][ODBC Microsoft Access Driver] ODBC--连接到 'SQL Server127.0.0.1' 失败。 <br>/web/packfile/test.asp, 第 15 行 <br><br>源代码如下: <br>&lt;html&gt; <br>&lt;head&gt; <br>&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=gb2312&quot;&gt; <br>&lt;title&gt;新建网页 1&lt;/title&gt; <br>&lt;/head&gt; <br>&lt;body&gt; <br>&lt;%@language=VBscript%&gt; <br>&lt;% <br>dim conn,rs <br>set conn=server.createobject(&quot;adodb.connection&quot;) <br>conn.open &quot;driver={microsoft access driver (*.mdb)};uid=admin;pwd=;dbq=E:/program/downdata.mdb&quot; <br>set rs=server.createobject(&quot;adodb.recordset&quot;) <br>rs.open &quot;SELECT * into sqldata FROM 省代码 IN ODBC [ODBC;Driver=SQL Server;UID=sa;PWD=;Server=127.0.0.1;DataBase=fordata]&quot;,conn <br>%&gt; <br>&lt;/body&gt; <br>&lt;/html&gt; <br>问题原文: <br>http://www.delphibbs.com/delphibbs/dispq.asp?lid=2745314 <br> <br>来自: lwn19820725, 时间: 2004-08-05 10:00:49, ID: 2749338 &nbsp;<br>多好的文章呀支持中。。。 <br> <br>来自: icet, 时间: 2004-08-05 10:32:08, ID: 2749423 &nbsp;<br>应该找个人整理整理这个贴子了,搞得现在经常都还有人讨论,而往往是没有必要的讨论。。。 <br><br> <br>来自: jackylo2008, 时间: 2004-08-05 11:07:21, ID: 2749540 &nbsp;<br>ATTN: 碧血劍 <br>請問一下,如何將SQL 數據表轉換成与 COBOL 語言開發所使用之數據文件呢? <br> <br>来自: cdmar79, 时间: 2004-08-07 15:48:44, ID: 2753466 &nbsp;<br>呵呵!没想到英雄所见略同! <br>我这几天也在琢磨这些!和你的思路几乎一样的!。。。。不过你比我要早想到1年啊!!!佩服佩服! <br>我还有几个问题不确定!想请教一下! <br>我是把SQL Server导到Access里,ADOConnect连接到了Access <br>问题是: <br>ODBC[ODBC;Driver=SQL Server;UID=sa;PWD=;Server=172.0.0.1;DataBase=Temp;]; <br>这条语句。 <br>当Access执行时,ODBC数据源会不会把SQL Server数据库锁住! <br>当Access执行完后,ODBC数据源(或Access)会自动析构这个临时的ODBC吗?(我看了看ODBC数据源管理那里是没有的,但是我不敢确定。因为这条语句没有指定ODBC的名称,我想也许ODBC数据源管理那里没反映出来!) <br>最后,这样做会有什么问题吗?比如内存泄露之类的。。。我发现我在执行了导数据之后机器就慢了不少(不知道是不是心理作用)! <br><br> <br>来自: blackbook, 时间: 2004-08-07 16:38:48, ID: 2753548 &nbsp;<br>这个好像很多年以前的大富翁都出现过了阿!我们公司一直都是这么用来做访问多个数据库,和数据库导出到access阿! <br> <br>来自: homeend0, 时间: 2004-08-16 17:22:40, ID: 2766788 &nbsp;<br>多好的一个方法。我晚上回家试试。我有3000万条记录。原来从interbase导入sql server 2000花了我30个小时。现在还有300万条没有导。晚上回去用这个办法试试会快多少。哈。真是多谢楼主了 <br> <br>来自: hong2002, 时间: 2004-08-16 18:50:54, ID: 2766948 &nbsp;<br>值得收藏,谢. <br> <br>来自: 朱梦翔, 时间: 2004-08-17 16:47:47, ID: 2768246 &nbsp;<br>不知道上边的办法数据量大了之后,速度会不会很慢 <br> <br>来自: advancer, 时间: 2004-08-19 8:53:22, ID: 2769184 &nbsp;<br>不错。 <br>感谢楼主的无私。 <br> <br>来自: 龙之天涯, 时间: 2004-08-19 12:05:56, ID: 2769779 &nbsp;<br>怎么试了那么久我还是没有办法把文本文件倒入ORACLE的数据库啊 <br><br>那位成功过了,给点代码参考一下吧 <br> <br>来自: 龙之天涯, 时间: 2004-08-19 18:03:32, ID: 2770536 &nbsp;<br>我试了WIND2000的办法都可以从ORACLE倒出,但是倒入就不行了 <br>那位来指点一下啊 <br> <br>来自: messah, 时间: 2004-08-20 13:33:18, ID: 2771679 &nbsp;<br>各位大哥们,请帮小弟一个忙。源数据在ACCESS数据库中,使用ADO连接,目标数据为pardox数据库,用table组件连接,请问如何将access库中指定表中指定字段的数据插入到指定的pardox数据库文件中去。谢谢。很急很急的。 <br> <br>来自: 龙之天涯, 时间: 2004-08-20 17:55:29, ID: 2772062 &nbsp;<br>看起来这个转入ORACLE的问题还是比较难的哦, <br>没有人解决过吗?? <br>转出的速度的确是很快,25000条记录,50秒就OK了. <br> <br>来自: lufang, 时间: 2004-08-25 19:01:34, ID: 2779246 &nbsp;<br>我从ORACLE将某表导入至ACCESS中,按碧血剑的方法如下: <br>ORACLE8.17,DELPHI6,使用ADO控件,SQL如下: <br>select * into ouform from DEPT_DICT in [ODBC][ODBC;Driver={Microsoft ODBC for Oracle};UID=COMM;PWD=COMM;SERVER=TEST;] <br>执行后返回如下错误,请问这是怎么回事?如何解决? <br>“Microsoft Jet 数据库引擎找不到输入表或查询'DEPT_DICT'。确定它是否存在,以及它的名称的拼写是否正确。” <br> <br>来自: lsnny, 时间: 2004-08-31 15:23:04, ID: 2787333 &nbsp;<br>昨天使用了从sql server转到text。成功!谢谢大家!但不知道怎样去除每条记录头尾得“”,请帮帮忙!!! <br> <br>来自: homeend0, 时间: 2004-08-31 17:48:27, ID: 2787718 &nbsp;<br>我用sqlserver--&gt;txt时。用下面的语句。结果生成的ttt.txt的内容有双引号,不知道哪位大吓有办法把双引号去掉。我就一个字段, <br>select aaa into ttt.txt from t_ttt in [ODBC][ODBC;Driver=SQL Server;UID=sa;PWD=;Server=127.0.0.1;DataBase=tttt;] <br> <br>来自: windwate, 时间: 2004-09-01 12:57:21, ID: 2788839 &nbsp;<br>请问能不能把sqlserver直接转到word呢 <br> <br>来自: lpc, 时间: 2004-09-06 16:29:57, ID: 2795744 &nbsp;<br>请问:以下代码中的“[aaa$]-&gt;Excel文件aaa.xls中的aaa页”具体参数或选项是什么? <br>多谢! <br>//Excel-&gt;Access <br>//[aaa$]-&gt;Excel文件aaa.xls中的aaa页 <br>procedure TForm1.Button10Click(Sender: TObject); <br>begin <br> sSql := <br> &nbsp; 'select * into bbb from [excel 8.0;database=f:/aaa.xls].[aaa$]'; <br> with AccessConnection do <br> &nbsp; begin <br> &nbsp; &nbsp; Connected := True; <br> &nbsp; &nbsp; Execute(sSql); <br> &nbsp; end; <br>end; <br> <br>来自: jackylo2008, 时间: 2004-09-13 16:05:39, ID: 2805314 &nbsp;<br>ATTN: 碧血劍 &nbsp;CC:各位大俠 <br>SQL=&gt; .TXT <br>如碧血劍所說之方法可以很快導出, 但問題是有几個欗位因想与其他語言銜接, 導出時想用此固定格式: 如單價(7位整數兩位小數): &nbsp;目前sql里如是: 123.45 , 現在導出的也是123.45 我要導出的是: 000012345 ,請位碧血劍和各位大俠該如何實現呢, 可否在schema.ini 設定呢? &nbsp; <br> <br>来自: dzj7507, 时间: 2004-09-14 1:12:39, ID: 2806014 &nbsp;<br>大家得讨论很精彩!! <br>我是新手,试上面得方法时提示说'找不到可安装得ISAM'为何?? <br>高手指点!! <br> <br>来自: jackylo2008, 时间: 2004-09-14 8:57:51, ID: 2806151 &nbsp;<br>ATTN: 碧血劍 &nbsp;CC:各位大俠 <br>SQL=&gt; .TXT <br>碧血劍,自從你結了婚以後,怎麼就不見你出來了了? 是否有了老婆就..... 說笑,見諒. <br>請問一下我要從sql導出成.txt且數據表資料要符合某种條件該如何實現呢? 比如: <br>無條件時: sql:='Select * into aaa.txt from 應收帳款信息表 IN [ODBC] [ODBC;Driver=SQL Server;UID=sa;PWD=sa;Server=868ser;Database=應收帳款系統;]'; <br>加條件時:1.導出之資料要符合 應收廠商:=變量A,應數年月:=變量B <br> &nbsp; &nbsp; &nbsp; &nbsp; (中間不通過暫時性表來過渡該如何處理); <br> &nbsp; &nbsp; &nbsp; &nbsp;2.導出之資料在USER 指定路徑; <br> &nbsp; &nbsp; &nbsp; &nbsp;3.導出之資料在不同路徑都一樣格式,即不要人為再去修改schema.ini 設定, <br> &nbsp; &nbsp; &nbsp; &nbsp; (是否先固定好一個schema.ini,再COPY 過去呢,還有否其他方法); <br> &nbsp; &nbsp; &nbsp; &nbsp;4.導出之格式中某些欗位要固定如此格式: <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;如單價(7位整數兩位小數): &nbsp;目前sql里如是: 123.45 , <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;現在導出的也是 123.45 <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;我要導出的是: &nbsp;000012345 , <br>如上也是很多開發者較為典型之問題, <br>請問碧血劍和各位大俠該如何實現較為理想呢? &nbsp;答OK者重獎!! 哈哈..... <br> <br>来自: lpc, 时间: 2004-09-14 11:06:21, ID: 2806463 &nbsp;<br>请问:碧血劍,我用以下方法把Excel导入到Access <br><br><br>procedure TForm1.Button1Click(Sender: TObject); <br>var sSql:string; <br>begin <br> sSql := <br> &nbsp; 'select * into ab1 from [excel 8.0;database=f:/book1.xls].[sheet1$]'; <br> with AccessConnection do <br> &nbsp; begin <br> &nbsp; &nbsp; Connected := True; <br> &nbsp; &nbsp; Execute(sSql); <br> &nbsp; end; <br>end; &nbsp; <br>但出现错误,提示:“表ab1已存在”。不能导入,请帮助。多谢! <br> <br>来自: eadber, 时间: 2004-09-21 12:07:15, ID: 2817165 &nbsp;<br>同,龙之天涯 <br>我也试验过,DBF,Access导入到Oracle这些方法都行不通啊 <br> <br>来自: babyrun, 时间: 2004-09-23 17:01:12, ID: 2821868 &nbsp;<br>Excel--&gt;Access;Access--&gt;Excel;Excel;txt--&gt;Access;Access--&gt;txt测试成功。怎奈小弟愚笨,Excel导入SQL SERVER2000,报from子句错,各位兄弟帮忙看看是我的sql有问题么?顺便给讲讲SQL SERVER2000导入Excel的具体细节。给出实例最好,小弟在此谢过。 <br><br>Excel联接ADO串 <br>Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=E:/test/change.xls;Extended Properties=Excel 5.0;Persist Security Info=False <br>-------------------------------------------------- <br>procedure TForm1.Button1Click(Sender: TObject); <br>var <br> sqltxt:String; <br>begin <br> Try <br> &nbsp; &nbsp; sqltxt:='SELECT * into newtable FROM OpenDataSource(Microsoft.Jet.OLEDB.4.0,Data Source=&quot;E:/test/change.xls&quot;;User ID=Admin;Password=;Extended properties=Excel 5.0)...xactions'; <br><br> &nbsp; &nbsp; ADOConnetion1.Close; <br> &nbsp; &nbsp; ADOConnetion1.ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=E:/test/change.xls;Extended Properties=Excel 8.0;Persist Security Info=False'; <br> &nbsp; &nbsp; ADOConnetion1.Execute(sqltxt); <br> &nbsp; &nbsp; Application.MessageBox('数据导出成功','系统信息',MB_OK+MB_IconInformation); <br> &nbsp; except <br> &nbsp; &nbsp; Application.MessageBox('数据导出失败','系统信息',MB_OK+MB_IconError); <br> &nbsp; end; <br><br> &nbsp; ADOConnetion1.Close; <br><br>end; <br><br>end. <br> <br>来自: Djoin, 时间: 2004-09-25 11:24:15, ID: 2824600 &nbsp;<br>导入已存在的表中(txt导入access) <br>要怎样写啊!我不懂! <br>各位大哥知道的能告诉我一下吗?谢谢! <br><br> <br>来自: protossgffnxk, 时间: 2004-10-06 11:53:11, ID: 2835736 &nbsp;<br>有没有什么办法获得ACCESS文件中的表名 <br> <br>来自: shijicatty, 时间: 2004-10-12 7:54:13, ID: 2844205 &nbsp;<br>我也想问同 Djoin 一样的问题,不能每次导入到SqlServer数据库中都建立一个表吧,我的excel表格是每天都添加薪数据的!!!急!!![:(] <br> <br>来自: liping0510, 时间: 2004-10-12 11:18:34, ID: 2844713 &nbsp;<br>各位大哥,我在access向txt和excel导出的时候总要出错,请指点 <br>另外在导出时请问adoconnection指向哪儿?? <br>这是access到excel的代码,帮忙看看 <br> ADOConnection4.ConnectionString:= <br>'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=e:/a.xls;' <br>+'Extended Properties=excel 8.0;Persist Security Info=False'; <br>ADOConnection4.Execute('SELECT * into user from [e:/db1.MDB;pwd=].user'); <br><br> <br>来自: zhaoxuncai, 时间: 2004-10-12 16:51:15, ID: 2845394 &nbsp;<br>这个贴真好!!!! <br> <br>来自: jfyes, 时间: 2004-12-15 16:12:52, ID: 2847689 &nbsp;<br>SQL Server2000提供的DTS比上面的那些方法都快,并且是多线程,导出或入多张表,效率极高,只要是系统提供有相关驱动程序,DTS都能完成。 <br> <br>来自: lamcy, 时间: 2004-10-17 13:22:25, ID: 2851126 &nbsp;<br>楼主说的方法是好用,但是事先需要建立一个空的ACCESS文件(我是要将TXT文件导入ACCESS文件),若指定目录中无ACCESS文件或ACCESS文件中已经有数据好像都会出错。我想是否有方法不用事先建立ACCESS文件或ACCESS文件由DELPHI自动产生? <br> <br>来自: oyangfong, 时间: 2004-10-25 10:27:49, ID: 2864358 &nbsp;<br>顶 <br> <br>来自: wmyu, 时间: 2004-10-26 13:15:56, ID: 2866722 &nbsp;<br>很不错 <br><br> <br>来自: jzpang1980, 时间: 2004-10-27 11:40:07, ID: 2868273 &nbsp;<br>我在Acess中执行 &nbsp; &nbsp;SELECT * FROM [excel 8.0;database=c:/a.xls].[1月$] <br>的时候,发现有几列数据不能够查询出来,显示为#数字!,其实本来是有数据的,不知道为什么显示不出来,但是在Excel中双击以后,重新执行,又可以把这个数字显示出来,但是这一列其它的数据还是和以前一样,显示为#数字!,请问这是什么原因呢!是不是和EXCEL中的设置有关呢? <br>同样,我在SQLSERVER中执行相应语句的时候,有数据也显示为NULL,这究竟是什么原因呢? <br>很着急,在线等,如果有哪位大侠能够帮助我解决这个问题,小弟不胜感激! <br><br>先谢过了。 <br><br> <br>来自: aRichMan, 时间: 2004-10-27 12:53:07, ID: 2868374 &nbsp;<br>收藏 <br> <br>来自: scottrayn, 时间: 2004-10-27 15:22:52, ID: 2868661 &nbsp;<br>高人之贴!!,哈哈 <br><br> <br>来自: 旅, 时间: 2004-10-27 15:47:39, ID: 2868718 &nbsp;<br>将本地DBF导入远端SQLSERVER时报错,请来这里指教: <br><br>http://www.delphibbs.com/delphibbs/dispq.asp?lid=2868664 <br><br>内容如下: <br>已经在本论坛查了相关的导入语句,但都不能生效 ;( <br>如: <br>----------------------------------------------------- <br>SELECT * into bmk <br>FROM OpenDataSource( ’Microsoft.Jet.OLEDB.4.0’, <br> ’Data Source=”e:/share”;User ID=Admin;Password=;Extended <br>properties=dBase 5.0’)...bmk <br>或 <br>select * from openrowset('MSDASQL', <br>'Driver=Microsoft Visual FoxPro Driver;SourceType=DBF;SourceDB=c:/', <br>'select * from [aa.DBF]') <br>----------------------------------------------------- <br><br>在本地开发端,用ADO连远端SQLSERVER没问题: <br>在本地用table控件打开dbf没问题 <br>以下为table控件属性: <br>-------------- <br>tabletype = ttbase <br>tablename = 'xxx.dbf' <br>databasename = 'd:/dbf' <br>-------------- <br>一个连接SQLSERVER的ADO,要执行什么语名才能一次性在SERVER上建一个同名表,并导入? <br>(设SERVER上已没有同名表,连接的ADO有权限在SQLSERVER加表) <br>请高手赐教!急! &nbsp; <br><br> <br>来自: philchan, 时间: 2004-10-30 10:41:30, ID: 2872630 &nbsp;<br>真的好好,昨天看到,今天就用上了: <br>if adoUpload.Connected=true then adoUpload.Close; <br> &nbsp; adoUpload.Execute('insert INTO msg_test (msg_citycode,msg_contents) select msg_citycode,msg_contents FROM OPENDATASOURCE(''SQLOLEDB'',''DRIVER=SQL &nbsp; &nbsp; &nbsp; Server;SERVER=127.0.0.1;UserID=sa;password=sa'').myDB.dbo.msg_processed where msg_type=10000'); <br>adoUpload.Close; <br><br>忍不住要说声谢谢。 <br><br><br><br> <br>来自: meteorcc, 时间: 2004-10-31 15:42:52, ID: 2873795 &nbsp;<br>真的很厉害啊,写的好啊!!佩服,佩服!! <br> <br>来自: jxauyhj, 时间: 2004-11-02 10:13:04, ID: 2875925 &nbsp;<br>高手!学习! <br> <br>来自: wiwei, 时间: 2004-11-02 15:19:25, ID: 2876566 &nbsp;<br>但我在SQL Server連Oracle卻不能 <br><br>我想在SQL SERVER 中访问ORACLE <br>我ORACLE的s_id=’test_ora’ <br>服务器名称是cn_test <br>用户 zhou 密码 abc123 <br><br>SELECT a.* <br>FROM OPENROWSET('MSDAORA', <br> &nbsp;'DRIVER={ORACLE};SERVER= test_ora;UID=zhou;PWD=abc123, <br> &nbsp;zhou.BARCODE) AS a <br>BARCODE是表名 <br>可它报错 <br>服务器: 讯息 7399,层级 16,状态 1,行 1 <br>OLE DB Provider 'MSDAORA' 报告了错误。 <br>[OLE/DB provider returned message: Oracle client and networking components were not found. These components are supplied by Oracle Corporation and are part of the Oracle Version 7.3.3 or later client software installation. <br><br>Provider is unable to function until these components are installed.] <br>各位看看错在什么地方 <br>或者是方法不对,该如何访问,多谢 <br><br> <br>来自: jwei119, 时间: 2004-11-03 10:04:50, ID: 2877843 &nbsp;<br>好久没有看到如此牛的贴子,大虾们继续上菜,密切关注中.................. <br> <br>来自: tjlqp, 时间: 2004-11-16 0:34:58, ID: 2893476 &nbsp;<br>国人都这样,中国软件业都如此,......中国有戏!!!!! <br> <br>来自: zsy146, 时间: 2004-11-20 8:32:56, ID: 2899722 &nbsp;<br>看了这贴子,受益颇深!感激。顶顶顶! <br> <br>来自: delphizdr, 时间: 2004-11-21 15:46:04, ID: 2901212 &nbsp;<br>非常佩服, 不知道碧血剑兄是如何知道的. <br> <br>来自: zsy146, 时间: 2004-11-25 10:22:44, ID: 2907605 &nbsp;<br>碧血剑兄: <br> &nbsp; 现在我遇到一个这样的问题:我的Access在本地电脑上,而我的数据库在服务器上,我怎样才能把Access中的数据取到Sql数据库中?我发现你提供的语句在服务器端的数据库上运行会发生OLE DB 提供程序 'Microsoft.Jet.OLEDB.4.0' 报错。不知有没有什么解决的办法? <br> &nbsp; &nbsp;<br> <br>来自: win1122, 时间: 2004-11-29 15:05:49, ID: 2912246 &nbsp;<br>用delphi7写一个com,用于实现sql server2000数据表中的记录输出为Excel文件,如何实现!请帮忙呀! <br> <br>来自: james_liu, 时间: 2004-11-29 18:53:06, ID: 2912608 &nbsp;<br>我用的不对,找不到安装的ISAM? <br>怎么回事? <br> <br>来自: messah, 时间: 2004-12-07 11:16:01, ID: 2921020 &nbsp;<br>碧血剑,你好,我想问下,我有一批pardox数据库文件需要导入到ACCESS数据库中,其中pardox数据库文件是加密码的,而我又是知道密码的,请问我该如何写代码来操作,谢谢。 <br> <br>来自: mxfhhh, 时间: 2004-12-12 11:13:18, ID: 2927841 &nbsp;<br>我也正遇到这种问题,真是很有用,一下子把我这方面的技术提高了很多 <br> <br>来自: mxfhhh, 时间: 2004-12-13 10:41:16, ID: 2928751 &nbsp;<br>goood <br> <br>来自: 凤冠坡, 时间: 2004-12-13 13:22:07, ID: 2928983 &nbsp;<br>有个问题就是这样复制的数据是没有加上索引, <br>如何把索引也同时复制呢?!! <br> <br>来自: jfyes, 时间: 2004-12-15 16:27:30, ID: 2932013 &nbsp;<br>http://www.delphibbs.com/delphibbs/dispq.asp?lid=2931989 <br> <br>来自: jfyes, 时间: 2004-12-15 16:28:13, ID: 2932015 &nbsp;<br>oracle to &nbsp;Ms sql server 中来 <br>http://www.delphibbs.com/delphibbs/dispq.asp?lid=2931989 <br> <br>来自: Carson_zzd, 时间: 2004-12-24 17:39:33, ID: 2943662 &nbsp;<br>to楼主: excel 的版本是2003 sql 的版本为2K <br>能写一个在SQL查询分析器里就可以执行的代码吗?(读取excel的内容) <br>SELECT * <br>FROM OpenDataSource('Microsoft.Jet.OLEDB.4.0','Data Source=&quot;d:/FileName.xls&quot;; <br>Extended Properties=&quot;Excel 8.0;HDR=Yes;&quot;;Persist Security Info=False')...sheet1$ <br>上面的是安装楼主的方式写的,可是查询分析器中提示: <br>================================== <br>服务器: 消息 7314,级别 16,状态 1,行 1 <br>OLE DB 提供程序 'Microsoft.Jet.OLEDB.4.0' 不包含表 'sheet1$'。该表可能不存在,或当前用户没有使用该表的权限。 <br>================================== <br>是什么原因? 希望给予解决 <br> <br>来自: wswcp, 时间: 2004-12-26 17:20:25, ID: 2945036 &nbsp;<br>提示找不到安装的ISAM? <br>怎么回事? &nbsp; <br><br> <br>来自: wswcp, 时间: 2004-12-26 18:43:05, ID: 2945076 &nbsp;<br>这个语句错在哪?能给改改吗? <br>ADOConnection1.Execute('SELECT * into [FoxPro 3.0;Database=F:/新建文件夹(2)].aaa.dbf &nbsp;FROM v_jfd1 IN [ODBC] [ODBC;Driver=SQL Server;UID=sa;PWD=;Server=127.0.0.1;DataBase=Region;]'); <br> <br>来自: GaveYu, 时间: 2005-01-17 19:40:27, ID: 2968059 &nbsp;<br>经典[:D][:)][^] <br> <br>来自: bjyplbx, 时间: 2005-01-18 11:13:22, ID: 2968553 &nbsp;<br>Access-&gt;oracle <br><br>ConStr: <br>Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:/Data.mdb;Persist Security Info=false <br><br>Sql: <br>SELECT * into aaa FROM pd_publish_file IN [ODBC][ODBC;Driver={Microsoft ODBC for Oracle};UID=hbkf;PWD=hbkf;SERVER=orakf;] <br><br>涓轰粈涔堟?绘槸鎶ラ敊锛岃?鎵句笉鍒拌〃 pd_publish_file锛屽彲鏄疧racle涓?偗瀹氭湁杩欎釜琛ㄣ?? <br><br> <br>来自: wpr321, 时间: 2005-01-22 13:09:51, ID: 2972450 &nbsp;<br>表已经存在的情况下使用 <br>SELECT * into bmk <br>FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', <br> 'Data Source=&quot;e:/share&quot;;User ID=Admin;Password=;Extended properties=dBase 5.0')...bmk <br><br>提示表已经存在,有什么办法可以最近记录,或者是只添加不重复的记录,重复的不添加(可以通过某键值判断)? <br> <br>来自: yzp, 时间: 2005-01-22 22:22:06, ID: 2972871 &nbsp;<br>在SQL SERVER 2000的查询分析器里运行insert语句是成功的: <br>insert into a_chengji (bianhao,yuwen,shuxue,yingyu) select bianhao,yuwen,shuxue,yingyu FROM OpenDataSource('Microsoft.Jet.OLEDB.4.0','Data Source=&quot;e:/yuan.xls&quot;;Extended Properties=&quot;Excel 8.0;HDR=Yes;&quot;;Persist Security Info=False')...chengji$ <br>在DELPHI中编程如下: <br>procedure Tf_chengji.BitBtn1Click(Sender: TObject); <br>var <br>s_kemuma,s_sql:string; <br>begin <br> s_kemuma:='yuwen,shuxue,yingyu' <br> open_xls.Execute; <br> s_sql:= 'insert into a_chengji (bianhao,'+s_kemuma+') select bianhao,'+s_kemuma+' FROM OpenDataSource('''+'Microsoft.Jet.OLEDB.4.0'+''''+ ','+''''+'Data Source=&quot;'+open_xls.filename+'&quot;;Extended Properties=&quot;Excel 8.0;HDR=Yes;&quot;;Persist Security Info=False'+''''+')...chengji$'; <br> ADOConnection2.ConnectionString:='Provider=SQLOLEDB.1;Persist Security Info=false;User ID=sys;Initial Catalog=tbms;Data ource='+'yuan'; <br> ADOConnection2.Execute(s_sql); <br>end; <br>提示错误是: <br>“已拒绝OLE DB提供程序'Microsoft.jet.OLEDB.4.0'的特殊访问,必须通过链接服务器来访问此提供程序。” <br>!!!!!!!!!!!!!yuan是服务器,也是计算机名称。我应该如何解决?请指点,谢谢! &nbsp; <br> <br>来自: yzp, 时间: 2005-01-22 22:30:21, ID: 2972876 &nbsp;<br>各位大哥帮帮忙,非常感谢,碧血剑哥哥,帮我想想,谢谢! <br> 我的QQ:29765025,E-MAILL:yzp_kf@126.com <br>http://www.delphibbs.com/delphibbs/DispQ.asp?LID=2941605 <br> <br>来自: photodelphi, 时间: 2005-01-28 16:23:35, ID: 2978521 &nbsp;<br>这张贴子这讨论了这么久呀,真是佩服呀!!! <br> <br>来自: 1979_ql, 时间: 2005-02-02 17:07:26, ID: 2983677 &nbsp;<br>下面我又出现了一个错误,还是SQL——VFP的。请help me <br>//MSSQL2VFP <br>ADOConnection2.ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:/;Extended Properties=dBase 5.0;Persist Security Info=False'; <br>ADOConnection2.Execute('select * into Abc.dbf from spxxk IN [ODBC] [ODBC;Driver=SQL Server;UID=sa;PWD=qianlin;Server=192.168.0.1;DataBase=QLsql]'); <br>//把一个MSSQL的数据库表及数据导出到VFP中,Abc.dbf 为VFP中不存在的表名,spxxk为MSSQL里的表, sa为用户, &nbsp;qianlin为密码 , 192.168.0.1为服务器地址 ,QLsql是ODBC中SQLserver数据源名称 <br>错误提示是:连接到192.168.0.1失败 <br>1。帮我看看这是什么原因 <br>2。DataBase后面跟的是ODBC中SQLserver数据源名称还是SqlServer中数据库的名称。 <br><br><br> <br>来自: szseawind, 时间: 2005-02-26 0:10:07, ID: 2997979 &nbsp;<br>好好好!!!!!!!!!!!!!1 <br> <br>来自: 中鼎, 时间: 2005-02-26 8:49:09, ID: 2998045 &nbsp;<br>好东东啊!顶 <br> <br>来自: crossrowman, 时间: 2005-02-26 13:23:39, ID: 2998280 &nbsp;<br>好贴!顶一下 <br> <br>来自: polaris_cn, 时间: 2005-02-27 19:46:31, ID: 2999162 &nbsp;<br>我能实现从excel导入到oracle数据,但是没有办法操作表啊. <br>我将一个excel文件导入到数据库能够成功,select * from ph_excel能够列出所有记录,但是加上条件就不行了。select * from ph_excel where jf='9999'.说jf不认识. <br>用 desc ph_excel,可以列出列名来。 <br>表:ph_excel中的字段为: <br> &nbsp;areano &nbsp;varchar2(255), <br> &nbsp;jf &nbsp; &nbsp; &nbsp;varchar2(255), <br> <br>来自: sxb_ok, 时间: 2005-02-28 15:19:17, ID: 2999962 &nbsp;<br>没得说的 <br> <br>来自: szseawind, 时间: 2005-03-04 13:24:40, ID: 3002867 &nbsp;<br>GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG <br> <br>来自: Neo_leaf, 时间: 2005-03-10 18:22:09, ID: 3010758 &nbsp;<br>TO:碧血剑 <br> &nbsp;你好, <br> &nbsp;感谢你的贡献。。。 <br> &nbsp;我想请教一个问题, <br> &nbsp;你现在只是实现了数据的导入导出,但是,如果我是不完全导出导入,即:我需要根据条件导出、导入。不知道该怎么办。。。。 <br> &nbsp;把条件写在哪里, <br> &nbsp;请老大明示。。。。 <br> &nbsp;感激不尽。。。。 <br> &nbsp;我的QQ236309574, <br> &nbsp;愿意与大家交流上面的内容。 <br> <br>来自: Neo_leaf, 时间: 2005-03-10 18:45:08, ID: 3010790 &nbsp;<br>其实我觉得如果要是能把所要导出/入的数据根据条件来进行操作,那样就更加完美了, <br>一点小意见 <br> <br>问题讨论没有结束 ...
 
[blue][/blue]在這碰到諸多的Delphi高手,看來前途一片光明呀,有趣有意思,相信會在很短的時間內,我的水平會上一個台階
 
可以实现了.<br>谢谢各位
 
多人接受答案了。
 
后退
顶部