Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 289
  • Last Modified:

Writing a text file from Database data

At the moment I have a 3 very simple tables - 'survey', 'value', and 'variable' that each follow the same structure of having 2 columns - 'Name' and 'Format'

The Variable table appears as below:

'Name'          Format
custom3        EMPTY
custom34      EMPTY
custom345    EMPTY

What I would like to do is that when any record is added or deleted from this database that a text file with the structure below is created.

<!ELEMENT custom3 EMPTY>
<!ELEMENT custom34 EMPTY>
<!ELEMENT custom345 EMPTY>

<!ENTITY % UDvariable_controls "custom3 | custom34 | custom345 ">

If possible I would also like to be able to have this saved with a '.dtd' extension rather than a '.txt' one. Any help will be greatly appreciated as I have got no-where with this.

  • 2
1 Solution
what language are u using?
Rob62Author Commented:
Well if it could be done in VBA it would be good. Can use VB.Net though
You would need to figure out how you add or delete the data from the table so you could do an if statement to check if the data has been added or deleted then from there use the FSO (File System Object ) which you add a reference to Microsoft Scripting Runtime by going to tools - > references and scrolling down and checking that option.

Then from there you can go to this site :


search for FSO and open the vb one, it will show you how to write to a text file. You could use concatention to rename the file type when you save the text file.

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now