Private Sub Form_Load() Set gCn = New ADODB.Connection gCn.CursorLocation = adUseClient gCn.Mode = adModeReadWrite gCn.ConnectionString = "PROVIDER=MSDataShape;Data PROVIDER=MSDASQL;dsn=dl;uid=dl;pwd=a;" gCn.Open
Dim myfile
If Dir$("c:\1.xml") <> "" Then Kill "c:\1.xml" End If
Dim sqlstr As String Dim rs As New ADODB.Recordset sql = "select * from dl.bas_bm"
Set rs = New ADODB.Recordset With rs .ActiveConnection = gCn .CursorLocation = adUseServer .CursorType = adOpenStatic .LockType = adLockOptimistic .Open sql .Save "c:\2.xml", adPersistXML End With End Sub不是乱码洒
agree with yizia(椅子) the ADO have the method : Save, it can save the recordset as XMl file.
我就用的这个冬冬,请问哪个版本可以?
你去这个网站看一看!这里有!
pl/sql developer5搜索一下就能找到
ADO Recordset have save method !
如何解决?
gCn.CursorLocation = adUseClient
gCn.Mode = adModeReadWrite
gCn.ConnectionString = "PROVIDER=MSDataShape;Data PROVIDER=MSDASQL;dsn=dl;uid=dl;pwd=a;"
gCn.Open
Dim myfile
If Dir$("c:\1.xml") <> "" Then
Kill "c:\1.xml"
End If
Dim sqlstr As String
Dim rs As New ADODB.Recordset
sql = "select * from dl.bas_bm"
Set rs = New ADODB.Recordset
With rs
.ActiveConnection = gCn
.CursorLocation = adUseServer
.CursorType = adOpenStatic
.LockType = adLockOptimistic
.Open sql
.Save "c:\2.xml", adPersistXML
End With
End Sub不是乱码洒
the ADO have the method : Save, it can save the recordset as XMl file.