D导出XML格式? ( 积分: 100 )

  • 主题发起人 主题发起人 ccponline
  • 开始时间 开始时间
C

ccponline

Unregistered / Unconfirmed
GUEST, unregistred user!
请问大家,以下的例子怎样写:
<?xml version=&quot;1.0&quot; encoding=&quot;GB2312&quot;?>
<FileId fileid=&quot;9&quot;>
<ResultSet>
<row id=&quot;0&quot;>
<col name=&quot;KHMC&quot;>客户2323</col>
<col name=&quot;BGDD&quot;>ASDFSADF</col>
<col name=&quot;TXDZ&quot;>SDFDSAFDSA</col>
<col name=&quot;YZBM&quot;>23454</col>
<col name=&quot;LXR&quot;>345</col>
<col name=&quot;DH&quot;>4325</col>
<col name=&quot;DH2&quot;>435242</col>
<col name=&quot;DH3&quot;></col>
<col name=&quot;CZ&quot;></col>
<col name=&quot;URL&quot;></col>
<col name=&quot;EMAIL&quot;></col>
<col name=&quot;KHSH&quot;>DD</col>
<col name=&quot;FWKH&quot;>345</col>
<col name=&quot;QHID&quot;>1</col>
<col name=&quot;QYLXID&quot;>1</col>
<col name=&quot;HYLXID&quot;>1</col>
<col name=&quot;JYFW&quot;></col>
<col name=&quot;KHYH&quot;></col>
<col name=&quot;YHZH&quot;></col>
<col name=&quot;FRDB&quot;></col>
<col name=&quot;ZCRQ&quot;></col>
<col name=&quot;JFRQ&quot;>2004-09-22</col>
<col name=&quot;FWFDQR&quot;>2004-12-31</col>
<col name=&quot;CSAZRQ&quot;></col>
<col name=&quot;ZXFWSKRQ&quot;></col>
<col name=&quot;ZYJKH&quot;>0</col>
<col name=&quot;SFFWSK&quot;>0</col>
<col name=&quot;ZJGXKH&quot;>0</col>
<col name=&quot;KJM&quot;></col>
<col name=&quot;KHLXID&quot;>2</col>
<col name=&quot;SWJID&quot;>2</col>
<col name=&quot;FJID&quot;>2</col>
<col name=&quot;FWRYID&quot;>26</col>
<col name=&quot;CJRQ&quot;>2004-09-21</col>
<col name=&quot;KHBZ&quot;></col>
</row>
</ResultSet>
</FileId>
 
请问大家,以下的例子怎样写:
<?xml version=&quot;1.0&quot; encoding=&quot;GB2312&quot;?>
<FileId fileid=&quot;9&quot;>
<ResultSet>
<row id=&quot;0&quot;>
<col name=&quot;KHMC&quot;>客户2323</col>
<col name=&quot;BGDD&quot;>ASDFSADF</col>
<col name=&quot;TXDZ&quot;>SDFDSAFDSA</col>
<col name=&quot;YZBM&quot;>23454</col>
<col name=&quot;LXR&quot;>345</col>
<col name=&quot;DH&quot;>4325</col>
<col name=&quot;DH2&quot;>435242</col>
<col name=&quot;DH3&quot;></col>
<col name=&quot;CZ&quot;></col>
<col name=&quot;URL&quot;></col>
<col name=&quot;EMAIL&quot;></col>
<col name=&quot;KHSH&quot;>DD</col>
<col name=&quot;FWKH&quot;>345</col>
<col name=&quot;QHID&quot;>1</col>
<col name=&quot;QYLXID&quot;>1</col>
<col name=&quot;HYLXID&quot;>1</col>
<col name=&quot;JYFW&quot;></col>
<col name=&quot;KHYH&quot;></col>
<col name=&quot;YHZH&quot;></col>
<col name=&quot;FRDB&quot;></col>
<col name=&quot;ZCRQ&quot;></col>
<col name=&quot;JFRQ&quot;>2004-09-22</col>
<col name=&quot;FWFDQR&quot;>2004-12-31</col>
<col name=&quot;CSAZRQ&quot;></col>
<col name=&quot;ZXFWSKRQ&quot;></col>
<col name=&quot;ZYJKH&quot;>0</col>
<col name=&quot;SFFWSK&quot;>0</col>
<col name=&quot;ZJGXKH&quot;>0</col>
<col name=&quot;KJM&quot;></col>
<col name=&quot;KHLXID&quot;>2</col>
<col name=&quot;SWJID&quot;>2</col>
<col name=&quot;FJID&quot;>2</col>
<col name=&quot;FWRYID&quot;>26</col>
<col name=&quot;CJRQ&quot;>2004-09-21</col>
<col name=&quot;KHBZ&quot;></col>
</row>
</ResultSet>
</FileId>
 
简单的就用Query.SaveToFile('xxx.xml');
 
自己写一个通用的函数就行了,很简单的
 
BDE的不知道,反正ADOQuery是可以直接SaveToFile('xxx.xml')的。
 
我写的结果是
<KHMC>客户2323<KHMC>
 
后退
顶部