求救,数据库导出xml(50分)

Z

zybzhen

Unregistered / Unconfirmed
GUEST, unregistred user!
求代码:
把数据A中的B表导出为xml文件,我希望
select a,b,c,d,e,f,g from A where g>='2006-08-01'
的数据写入到import20060801.xml中,并且需要的时候,可以从import20060801.xml中恢复数据
 
S

starxes

Unregistered / Unconfirmed
GUEST, unregistred user!
如果要生成的xml没有格式要求的话,可以用delphi的TQuery+TDatasetProvider+TClientDataSet组合,用TClientDataset自身的SaveToFile('filename',dfXML)过程保存到文件中,恢复时用LoadFromFile
 
Y

yitang

Unregistered / Unconfirmed
GUEST, unregistred user!
如果没什么要求的话,下面的就行了
adoquery1.SQL.Text:='select * from sn_cycle';
adoquery1.Open;
adoquery1.SaveToFile('c:/test.xml',pfxml);
如果有格式要求,我想要一条记录一条记录写进xml文件了。
 
Z

zybzhen

Unregistered / Unconfirmed
GUEST, unregistred user!
给各有格式要求的例子吧
比如
<table>
<basys xmlns=&quot;x-schema:#Schema1&quot;
fs=&quot;7&quot;
cs=&quot;1&quot;
ah=&quot;162259&quot;
/>
<basys xmlns=&quot;x-schema:#Schema1&quot;
fs=&quot;2&quot;
ycs=&quot;1&quot;
ah=&quot;502462&quot;/>
</table>
 
D

duhai_lee

Unregistered / Unconfirmed
GUEST, unregistred user!
savetofile 和loadfromfile
 
Z

zybzhen

Unregistered / Unconfirmed
GUEST, unregistred user!
接受答案了.
 

Similar threads

S
回复
0
查看
731
SUNSTONE的Delphi笔记
S
S
回复
0
查看
613
SUNSTONE的Delphi笔记
S
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
顶部