Create an external XML file (1 Viewer)

Gustavo Miller

New member
Local time
Today, 02:11
Joined
Jan 23, 2022
Messages
10
Hello everyone! I hope you are not having a just a good day, but having an awesome day!
I have a local table on my application (Microsoft Access) in where I store some XML information. I use about 12 different XMLs. When user loads a new version of the application; the Startup process goes through the XML table and creates an external file. This way the application can make reference to some default information.

One of the XML files contains the Ribbon configuration; labels, screentip and supertip, along other information that I use at runtime.
The file has been created with no issues for the past 1.5 years and suddenly now the files are created blank. File is empty. I thought at first that it was an encoding but no matter what it creates the file blank. The other XML files create with no issues.

What creates the file? here is the code:

mContents = MySysTable!XML '<!-- Comes from the table
Set f = oFiles.FSO.GetFile(mFilename) 'Get file handler '<!-- mFileName is a parameter passed to method
Set ts = f.OpenAsTextStream(ForWriting, TristateUseDefault)
ts.Write vbNullString & mContents
ts.Close

Nothing really spectacular, but it works for some and it does not work for two of them. (btw. I have validated the XML code with Free Online XML Validator). I have attached one of the XML (already in a file -created by Visual Studio Code), the XML contents is in a table.
 

Attachments

  • ribboncontrols.xml.txt
    36.2 KB · Views: 278

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 07:11
Joined
Jul 9, 2003
Messages
16,271
I notice you have not yet received a reply, hence I am bumping your question up the list :)
 

Gustavo Miller

New member
Local time
Today, 02:11
Joined
Jan 23, 2022
Messages
10
Thank you Uncle Gizmo! Still have not fixed the issue; super weird problem.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 23:11
Joined
Oct 29, 2018
Messages
21,449
mContents = MySysTable!XML '<!-- Comes from the table
Is MySysTableXML the name of your XML table? If so, aren't you supposed to be using a recordset instead? Does that line not produce any error? If not, can you please post the complete code? Thanks.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 14:11
Joined
May 7, 2009
Messages
19,228

Gustavo Miller

New member
Local time
Today, 02:11
Joined
Jan 23, 2022
Messages
10
Hello Arnelgp. Thank you for your input. It is much appreciated.

These are not Ribbon XML's - those are stored in the USysRibbons System table. The application Ribbons work fine.

I have additional custom XML files, which are stored in a separate file: MSysXML (I created this file).
What makes this error very interesting, is that, out of 9 xml's files that I create only two fail; the other ones are created without a problem.

To edit and maintain these XML files (all of them) I use Visual Studio Code. Then, from Visual Studio Code (where I maintain the XMLs), I transfer them into the MSysXML table (each on its own record) and in production these XML's are extracted from the MSysXML and turned into external XML files (deleted after these are created).

Visual Studio Code --> MSysXML (access table) --> Production Database (users) --> External Files.
I included 1 of the XML's that fails - the content of this file is stored in the MSysXML (Fieldname:XML)
 

Attachments

  • sqlstatements.zip
    6.6 KB · Views: 261

Users who are viewing this thread

Top Bottom