Solved

XML/XSLT Rendering problem

Posted on 2013-02-07
9
415 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

705 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

19 Experts available now in Live!

Get 1:1 Help Now