Dim iii, ii As Integer
Dim TableName As String
Dim tempDoc As MSXML2.DOMDocument 'xml文件
Dim tempNode As MSXML2.IXMLDOMNode
Dim Root As MSXML2.IXMLDOMElement
Dim tempelement As MSXML2.IXMLDOMElement
Dim tempattribute As MSXML2.IXMLDOMElement
Dim emp As MSXML2.IXMLDOMElement
TableName = "XML" & Format(Now(), "MMDDHHMMSS")
'生成一个XML DOMDocument对象
Set tempDoc = New MSXML2.DOMDocument
'生成根节点并把它设置为文件的根
Set Root = tempDoc.createElement(TableName)
Set tempDoc.documentElement = Root
For iii = 1 To VsGrid.Rows - 1
Set emp = tempDoc.createNode(MSXML2.NODE_ELEMENT, TableName, "")
Root.appendChild emp
For ii = 1 To VsGrid.Cols - 1
'生成孩子节点添加到根节点上去,并且为这个节点设置一个属性
Set tempNode = tempDoc.createNode(MSXML2.NODE_ELEMENT, Trim(VsGrid.TextMatrix(0, ii)), "")
tempNode.Text = Trim(VsGrid.TextMatrix(iii, ii)) emp.appendChild tempNode
Next ii
Next iii
Dim pi As IXMLDOMProcessingInstruction
Set pi = tempDoc.createProcessingInstruction("xml", "version='1.0' encoding='gb2312'")
Call tempDoc.insertBefore(pi, tempDoc.childNodes(0))
'直接保存成文件即可
tempDoc.Save FileName
ExportXml = True
错误在红色字的那行。提示的错误是“存储空间不足,无法完成操作”
所要导的数据超过50w
Dim TableName As String
Dim tempDoc As MSXML2.DOMDocument 'xml文件
Dim tempNode As MSXML2.IXMLDOMNode
Dim Root As MSXML2.IXMLDOMElement
Dim tempelement As MSXML2.IXMLDOMElement
Dim tempattribute As MSXML2.IXMLDOMElement
Dim emp As MSXML2.IXMLDOMElement
TableName = "XML" & Format(Now(), "MMDDHHMMSS")
'生成一个XML DOMDocument对象
Set tempDoc = New MSXML2.DOMDocument
'生成根节点并把它设置为文件的根
Set Root = tempDoc.createElement(TableName)
Set tempDoc.documentElement = Root
For iii = 1 To VsGrid.Rows - 1
Set emp = tempDoc.createNode(MSXML2.NODE_ELEMENT, TableName, "")
Root.appendChild emp
For ii = 1 To VsGrid.Cols - 1
'生成孩子节点添加到根节点上去,并且为这个节点设置一个属性
Set tempNode = tempDoc.createNode(MSXML2.NODE_ELEMENT, Trim(VsGrid.TextMatrix(0, ii)), "")
tempNode.Text = Trim(VsGrid.TextMatrix(iii, ii)) emp.appendChild tempNode
Next ii
Next iii
Dim pi As IXMLDOMProcessingInstruction
Set pi = tempDoc.createProcessingInstruction("xml", "version='1.0' encoding='gb2312'")
Call tempDoc.insertBefore(pi, tempDoc.childNodes(0))
'直接保存成文件即可
tempDoc.Save FileName
ExportXml = True
错误在红色字的那行。提示的错误是“存储空间不足,无法完成操作”
所要导的数据超过50w
解决方案 »
- VB连接SQL方法
- 请教各位:用VB写的软件,如何用setup factory打包使程序开机自运行啊?
- vb 7-bit的编码,怎么解码,要vb的代码
- 让combo控件失效,不能击发任何事件,但不能让该控件变成灰色?
- 请问:怎样动态生成MSFlexGrid控件??在线等!!!!!!!!!!
- 各位师兄我现在一个关于treeview的问题急需解决,请帮我看看
- 给出简单的UDP的例子
- 贴子难懂啊!强烈建议大家提问或回答时,说清楚点,少点错别字!
- 我用VB编写了一个程序,当程序运行时想把它直接在屏幕工具条的右方(显示时间那一块儿)最小化,运行完后最小化的窗体自动消失。该如何在程序中编写?
- 如何在vb里用opengl?(内空)
- 关于此功能的实现
- 访问无文件系统的SD 卡
http://blog.csdn.net/supermanking/article/details/5989227