append to XML file

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Apr 2006
Posts: 16
Reputation: kamitsin is an unknown quantity at this point 
Solved Threads: 0
kamitsin kamitsin is offline Offline
Newbie Poster

append to XML file

 
0
  #1
May 5th, 2006
I was saving some data to a new XML file using the following code

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1.  
  2. Public myFileName, NewFileSave As String
  3. Dim xml As New ChilkatXml
  4. Dim outXml As New ChilkatXml
  5. Dim node As ChilkatXml
  6. Dim nextNode As ChilkatXml
  7.  
  8. Private Sub Command47_Click()
  9. CommonDialog1.ShowSave
  10. NewFileSave = CommonDialog1.FileName
  11. MsgBox NewFileSave
  12. xml.SaveXml NewFileSave
  13. MsgBox "Saved"
  14. CancelButton:
  15. Exit Sub

But now i also require to append the data to an existing XML file.

Can someone help me with the appending part.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: append to XML file

 
0
  #2
May 5th, 2006
I've never heard of the ChilkatXml object before.... I'm guessing it's a module that perhaps you installed.... you might want to check the documentation on it, I'm sure it has an option for appending data. In VB, you can open a file for appending as such:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. open filename for append as #1
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 16
Reputation: kamitsin is an unknown quantity at this point 
Solved Threads: 0
kamitsin kamitsin is offline Offline
Newbie Poster

Re: append to XML file

 
0
  #3
May 8th, 2006
Yes i have installed the ChilkatXml module.

I have checked the documentation of ChilkatXml but could not get much on the appending part.

Have tried

open filename for append as #1

but in my application it is not working and is overwriting the exisitng file.

Is there any other method by which i can append to a file ???

Thanks.
Amit
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: append to XML file

 
0
  #4
May 8th, 2006
Only if you want to get crazy, and try to do it through a dos command line...say, using shell, or making a batch file, and then shelling the batch file. Opening a file for append should never over-write anything, unless there is already nothing there. Appending a file means literally to add to the end of. I suppose you could post your code that appends, so we can check it out.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 7668 | Replies: 3
Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC