troubleshooting Question

Maximum Size of String Variable to Hold XML Document Created with VBA???

Avatar of Eric Sherman
Eric ShermanFlag for United States of America asked on
Microsoft Access
7 Comments1 Solution4995 ViewsLast Modified:
I am using Access and VBA to create an XML Document that will post to an IP for the purpose of faxing documents.  I have the VB code written to  accomplish this but my question is relating to...

Will the XML Document be limited to the 64k (I think) max size of a string variable???  This becomes a "VERY LARGE" string variable because the PDF file that's actually being faxed is encoded and included within the <document_list> </document_list> tags.  I did not post all the encoded results within those tags but I think you can get the idea if you review the output below from the strXMLDocument variable after it is created.  Within my test environment I can create and send faxes with 17 pages and have not received any errors but when the client ran the application in their environment the first time the got the message...

Run-time error '3163' The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data.

The next time they ran the application it worked, sent the faxes and did not generate any errors. Strange!!!!

This is the only variable in the whole scheme of things I could think of that could possibly cause that error and is why I'm asking the question.

Dim XmlDocument as string

XmlDocument =  "xml document is created here"  and the output looks like the following ...

<?xml version="1.0" encoding="UTF-8"?>
<single_fax_info xmlns="" xmlns:xsi="">
    <billing_code>Monthly Statement</billing_code>
    <fax_recipient_name>John Doe</fax_recipient_name>
<document document_content_type="application/PDF" document_encoding_type="base64" document_extension="PDF">JVBERi0xLjMNCjEgMCBvYmoNCjw8DQovQ3JlYXRvciA8RkVGRjAwNzAwMDY0MDA2NjAwNUYw
"                          <--------------This very large and is the encoded pdf file

Mybe there's a better way to create that xml document rather than store it to a string variable.


Our community of experts have been thoroughly vetted for their expertise and industry experience.

Log in to continue reading
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform for $9.99/mo
View membership options
Unlock 1 Answer and 7 Comments.
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
The Value of Experts Exchange in My Daily IT Life

Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>


Owner of Outages.IO
Phoenix, Arizona, United States
Member Since 2016
Join a full scale community that combines the best parts of other tools into one platform.
Unlock 1 Answer and 7 Comments.
View membership options
“All of life is about relationships, and EE has made a virtual community a real community. It lifts everyone's boat.”
William Peck

Member since 2004