Dim strSQL As String Dim rst As DAO.Recordset strSQL = "SELECT QuoteNumber, AccountNumber, Sku FROM Sku_Submission" Set rst = CurrentDb.OpenRecordset(strSQL) ' strPath = CurrentProject.Path & "\CategoryList.xml" strPath = "C:\Users\xxxx\OneDriveinc\Desktop\Escalation\EE\SkuSubmission.xml" Set fso = CreateObject("Scripting.FileSystemObject") Dim objFile As Object Set objFile = fso.CreateTextFile(strPath, True, True) objFile.Write "<?xml version='1.0'?>" & vbCrLf objFile.Write "<EsrpPriceRequest>" & vbCrLf Do Until rst.EOF objFile.Write "<QuoteNumber>" & rst.Fields("QuoteNumber") & "</QuoteNumber>" & vbCrLf objFile.Write "<AccountNumber>" & rst.Fields("AccountNumber") & "</AccountNumber>" & vbCrLf objFile.Write "<Item>" & rst.Fields("Sku") & "</Item>" & vbCrLf rst.MoveNext Loop objFile.Write "</EsrpPriceRequest>" rst.Close Set rst = Nothing MsgBox "Complete"This Output like this:
<?xml version="1.0" encoding="UTF-8" standalone="true"?> -<EsrpPriceRequest> <QuoteNumber>0030017523</QuoteNumber> <AccountNumber>0800000713</AccountNumber> -<Items> <Item>3BA56</Item> <Item>1A005</Item> <Item>1AC47</Item> <Item>6K305</Item> </Items> </EsrpPriceRequest>
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
An Experts Exchange subscription includes unlimited access to online courses.Get Started
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE