Solved

XML/XSLT Rendering problem

Posted on 2013-02-07
9
426 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

 

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
 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

749 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