Solved

XML/XSLT Rendering problem

Posted on 2013-02-07
9
420 Views
Last Modified: 2013-02-08
I have a process that uses a string variable and sets it to a string coming out of SQL Server.
The string is actually an Employment Application rendered as XML using XSLT

The variable is then displayed in a browser control in MS Access 2003

My process works in tens of thousands and thousands of cases

However...
In a couple of cases...when the string variable is VERY long...the Web Browser shows theres a xml error with invalid characters.

So...
Is there a physical limit on what a string variable can be set to?

Here is (partially) the code that displays the XML in the Web Browser control

Private Sub Form_Current()
    'This cannot be in Form Load...as Active-X COntrol Loads First
    Dim strURL As String
    Dim objIE As Object

    strURL = "C:\NNTEMP\FullApp.xml"
    Set objIE = Me.Frame1.object
    objIE.navigate strURL
End Sub

Private Sub Form_Load()
    Dim strXML As String
    Dim cmd As New ADODB.Command
    Dim retSet As ADODB.Recordset
    Dim intPos As Integer
    Dim strID As String
    Dim strCreatedDate As String
    
    If Len(Me.OpenArgs) > 0 Then
        'Set variable values
        intPos = InStr(Me.OpenArgs, "|")
        strID = Left$(Me.OpenArgs, intPos - 1)
        strCreatedDate = Mid$(Me.OpenArgs, intPos + 1)
         'Create record in database
        Set cmd.ActiveConnection = Conn
        cmd.CommandType = adCmdStoredProc
        cmd.CommandText = "usp_FullAppXMLget"
        cmd.Parameters("@id") = strID
        Set retSet = cmd.Execute
        
        If Not retSet.EOF Then
            strXML = retSet![XmlDoc]
        End If
        'Close out connections and recordsets
        Set cmd = Nothing
        Set retSet = Nothing
        
        lblHeader.Caption = "Created on " & strCreatedDate

        'This creates a file
        Open "C:\NNTEMP\FullApp.xml" For Output As #1
        Print #1, strXML
        Close #1    Else
        lblHeader.Caption = "No Data to Load"
    End If
    
    'This creates file on run does as well
    'With CreateObject("ADODB.Stream")
    '.Type = 2
    '.Charset = "utf-16"
    '.Open
    '.WriteText sXML
    '.SaveToFile sFilename, 2
    '.Close
    'End With
    
End Sub

Open in new window

0
Comment
Question by:lrbrister
  • 5
  • 3
9 Comments
 
LVL 48

Expert Comment

by:PortletPaul
ID: 38866473
sorry - let's play 20 questions:

what version of: Sql Server, Access and IE?
how big is "very big"?
Can you get to the xml file directly?
Is the xml well formed?
Is the file UTF8? (if not what encoding?)

can you upload one of these files? (don't edit it if possible, if you must edit use something like Notepad++ and don't change the encoding. Please indicate if yo have edited the file.)
0
 

Author Comment

by:lrbrister
ID: 38867779
SQL Server 2005
MS Access 2003
In Access it's the Web Browser Control
XML is fine.  If I take and place it in Visual Studio and "View in  Browser" it renders just fine.
Also...the other 10's of thousands of Applications can open with the same process.

That's why I'm wondering if the MS Access Web Browser Control has a physical limit?
This is what the control looks like on the Form

SP
0
 
LVL 84
ID: 38868480
If you take the XML you output at C:\NNTEMP\FullApp.xml and run it through a validator does everything work as expected?

Note the other question here: http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_28023644.html#a38868470
0
 

Author Comment

by:lrbrister
ID: 38868591
LSMConsulting
I ran it through the validator at http://www.w3schools.com/xml/xml_validator.asp and it's fine.

There MUST be some kind of MS Access 2003 Web Browser control
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 84
ID: 38868642
There are very few controls certified to work in the Access environment. In general, if you need to work outside the boundaries of Access you should move up to .NET or some other appropriate language.

What are you referring to here:

the other 10's of thousands of Applications can open with the same process.
Do you have this same process running in other deployments and are having troubles with only a handful of machines? Or are you referring to something else?
0
 

Author Comment

by:lrbrister
ID: 38868723
LSM Consulting

I agree and am trying to get the customer to move to .Net

In the meantime, This Access application is an ADP.
Each user at login gets a copy on their desktop

They review countless numbers of Employment Applications - all using this process.

About 1/10th of 1% have an issue rendering.
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 38868746
So you have other machines running the same FE, and some will error ON THE SAME RECORD while others do not error ON THE SAME RECORD?

If so, then you obviously have issues with those machines regarding the installation of Office, Windows, or Internet Explorer (or one of the dependent libraries). Note too that sometime a corrupt user profile can cause issues like this - to test that, try logging in as a different user on a machine that exhibits this behavior.

You can try a repair/reinstall of Office and/or Windows on a machine having issues. That would tell you if doing so would resolve the issues.
0
 

Author Comment

by:lrbrister
ID: 38868775
LSMConsulting

I'll have the Network/Office team do a MS Office setup again
0
 

Author Closing Comment

by:lrbrister
ID: 38869219
Old machines were the ones having a problem.
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now