FrankLu
asked on
How to write a recordset with Access VBA in an XML file
Dear all
I try to write a record or recordset to an empty XML File.
This is my code. But I get run-time error 424.
I would appreciate some help.
Thanks in advance.
Best regards
Frank
I try to write a record or recordset to an empty XML File.
This is my code. But I get run-time error 424.
I would appreciate some help.
Thanks in advance.
Best regards
Frank
Sub Write_Recordset_toXMLFile()
Dim strSQL As String
Dim file_name As String
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
file_name = "C:\Development\Access\Test\xml_test.xml"
rst.ActiveConnection = CurrentProject.Connection
strSQL = "SELECT tblLink.ID, tblLink.Frontend, tblLink.FrontendPath FROM tblLink WHERE (((tblLink.ID)=1));"
rst.Open strSQL
rs1.Save "file_name", adPersistXML 'Run-Time error '424'
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You're welcome.
ASKER
Thank you for your reply. It worked fine.
Best regards
Frank