Results 1 to 7 of 7
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Output to XML (Acc2K, Win2KPro)

    I know in ASP you can query a db and output the data to a file use fso.CreateTextFile, and I'd like to do the same in an Access project. Currently I am building the markup VBA and outputting the results to a textbox, so I can 'manually' create the file I want but I was wondering if it's possible to do this directly out if VBA...

    TIA

  2. #2
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Output to XML (Acc2K, Win2KPro)

    Hi Steve

    I feel you may be making yourself a lot of hard work..I have seen this mentioned on a couple of access forums over the months:

    http://www.rpbourret.com/xmldbms/ It is a freeware middleware option that you may want to utilise in one shape or form otherwise it will probably mean an update to Access 2K2+ Hope that helps
    Jerry

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Output to XML (Acc2K, Win2KPro)

    thanks for the reply! however, perusing the suggested tool seems to indicate it is for reading XML into a db, not the other way around... What i am trying to do is set up some kind of system to allow a user to create the XML file needed to support a web survey without that user knowing "diddly" about XML. FWIW, I have a partial solution with a function that outputs XML-legal strings to a textbox but currently I am having trouble getting the output to not overwrite when processing a loop. Something in my logic is a little off...

    a more basic question I have in mind is, can Access do fso.CreateTextFile or similar operations or are we limited to the OutputTo... options explicitly declared (text, excel, etc.)...

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Output to XML (Acc2K, Win2KPro)

    If you use code, you can use fso.CreateTextFile or the old Basic Open, Write, Print etc. instructions to create and fill a text file. But you'll have to write all the loops yourself - you can't mix those instructions with TransferText or OutputTo.

  5. #5
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Output to XML (Acc2K, Win2KPro)

    that's fine - I'm working on the logic for outputting XML to a string right now. I'd *like* to set it up to output to text with a dialog so the user can save to.XML, not .txt. Say, click a button "compile to XML" and the VBA module outputs a stream which can then be saved to a directory with the standard name websurvey.xml.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Output to XML (Acc2K, Win2KPro)

    Unlike the export to text built into Access, the CreateTextFile method of FileSystemObject doesn't care about the extension you use, so it's possible to create a file named websurvey.xml.

    To prompt the user for a folder, you can use the BrowseFolder function from <post:=587,729>post 587,729</post:>.

  7. #7
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Output to XML (Acc2K, Win2KPro)

    OK, thanks - I think I'll get it to work-- I'm sure I'll come back again if I feel the need! <img src=/S/aussie.gif border=0 alt=aussie width=21 height=22>

Posting Permissions

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