DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   Visual Basic 4 / 5 / 6 (http://www.daniweb.com/forums/forum4.html)
-   -   append to XML file (http://www.daniweb.com/forums/thread44828.html)

kamitsin May 5th, 2006 2:36 am
append to XML file
 
I was saving some data to a new XML file using the following code

 
Public myFileName, NewFileSave As String
Dim xml As New ChilkatXml
Dim outXml As New ChilkatXml
Dim node As ChilkatXml
Dim nextNode As ChilkatXml
 
Private Sub Command47_Click()
CommonDialog1.ShowSave
NewFileSave = CommonDialog1.FileName
MsgBox NewFileSave
xml.SaveXml NewFileSave
MsgBox "Saved"
CancelButton:
Exit Sub

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

Can someone help me with the appending part.

Comatose May 5th, 2006 5:05 pm
Re: append to XML file
 
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:
open filename for append as #1

kamitsin May 8th, 2006 12:58 am
Re: append to XML file
 
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

Comatose May 8th, 2006 9:31 am
Re: append to XML file
 
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.


All times are GMT -4. The time now is 4:05 am.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC