Results 1 to 5 of 5

Thread: [RESOLVED] Save and load data from textboxs with XML ??

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2003
    Posts
    830

    Resolved [RESOLVED] Save and load data from textboxs with XML ??

    I searched the net and the forums, but have not seem true XML examples. Is there a way to save the data from text boxes as XML and then load them back? Examples would be great.

    Thanks!

  2. #2
    Member Aaron_Redmond's Avatar
    Join Date
    Mar 2006
    Location
    Ireland
    Posts
    34

    Re: Save and load data from textboxs with XML ??

    Can you be a bit more specific.

    Check out the following threads for examples of working with XMLs

    http://www.vbforums.com/showthread.p...ument+examples

    http://www.vbforums.com/showthread.p...ument+examples

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2003
    Posts
    830

    Re: Save and load data from textboxs with XML ??

    Thanks. I got one of those examples to work using this:

    Added a reference to MSXML version 6.

    My xml file located at c:\test.xml

    Code:
    <COMMAND>
     <WHOIS>
      <NAME>That is me</NAME> 
     </WHOIS>
    </COMMAND>
    My vb code:

    Code:
    Private Sub Form_Load()
        Dim docFile As New DOMDocument30
        Dim docParent As IXMLDOMNode
        Dim docName As IXMLDOMNodeList
        Dim intIndex As Integer
        
        docFile.Load "C:\test.xml"
        Set docParent = docFile.documentElement.selectSingleNode("WHOIS")
        Set docName = docParent.selectNodes("NAME")
        
        Debug.Print "test"
        
        For intIndex = 0 To docName.length - 1
            Debug.Print docName(intIndex).Text
        Next
        
        Set docParent = Nothing
        Set docName = Nothing
    End Sub

    Ultimately, I am trying to save textbox values to an XML file so that I can recall or load them back in later on.

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2003
    Posts
    830

    Re: Save and load data from textboxs with XML ??

    The above may get me going to load XML in.

    Ideas or samples on getting it out?

    Thanks!

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2003
    Posts
    830

    Re: Save and load data from textboxs with XML ??

    Oops... found one here that might get me going.

    Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width