Re: Persisted XML files cannot be opened...

From: Joseph Geretz (jgeretz_at_nospam.com)
Date: 02/25/04


Date: Tue, 24 Feb 2004 23:20:13 -0500

Hi Val,

Here's the code. (Note that I'm dealing with an XML string in memory, rather
than in an external file.) The failure occurs on the second line of code.
The first statement plucks an ADO recordset, stored as an XML fragment, from
a larger XML document and the second statement reconstitutes it as an ADO
recordset.

       PersistedRecSet = m_XMLPackO.FacadeData("RSMail")
       Set m_RSMail = XMLStrToRecSet(PersistedRecSet)

The significant work here is done by XMLStrToRecSet which accepts a string
parameter and returns a recordset from it. Internally, this function loads
the string parameter into a DOM and then calls XMLToRecSet which performs
the actual load of the recordset from the XML DOM (function listed below).
It's all pretty standard. The error message points to a problem in the MDAC
subsystem which is outside my direct programmatic control, but I'd love to
find a solution. My client will not be happy to re-install the OS. (Although
personally, that's exactly what I do myself as soon as a new machine comes
out of the box. This one came from Dell with XP Pro preinstalled. I hate
those OEM preinstallations. You never know what you're getting.)

Thanks for your help,

- Joe Geretz

Public Function XMLToRecSet(XMLDOM As MSXML2.DOMDocument40) As
ADODB.Recordset

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Transforms an XML DOM into a recordset. '
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

    Dim RS As ADODB.Recordset

    On Error GoTo ErrHandle

    Set RS = New ADODB.Recordset

    RS.CursorLocation = adUseClient
    RS.Open XMLDOM
    Set RS.ActiveConnection = Nothing

    Set XMLToRecSet = RS
    Set RS = Nothing

    Exit Function

ErrHandle:

   If Err.Source = C_LIB Then
      Err.Raise Err.Number, C_LIB & C_CLASS & "XMLToRecSet", Err.Description
   Else
      Err.Raise Err.Number, Err.Source, Err.Description
   End If

End Function

"Val Mazur" <group51a@hotmail.com> wrote in message
news:OP8mo60%23DHA.2212@TK2MSFTNGP10.phx.gbl...
> Hi Joseph,
>
> If it is working on other PCs, then I would assume that something is
> corrupted on your PC. Could you post code, which opens XML file?
>
> --
> Val Mazur
> Microsoft MVP
>
> "Joseph Geretz" <jgeretz@nospam.com> wrote in message
> news:u2G4j4x%23DHA.1792@TK2MSFTNGP12.phx.gbl...
> > I'm getting a most bizarre error and I'm at my wits end trying to
diagnose
> > this:
> >
> > Persisted XML files cannot be opened with the version of the Microsoft
XML
> > Parser currently installed on this computer. Upgrade your system through
a
> > Windows 95/98 Service Release or Internet Explorer 5.0 or later.
> >
> > OK, I know where this error is emanating from. I do use XML to persist
and
> > de-persist recordsets in my software. The minimum supported platform is
> > Win2K. The software is running on hundreds of workstations with no
> > problem.
> > What makes this error message so bizarre is that, in this case, the
> > software
> > is running on Win XP Pro. Yet the error message recommends a Win 95/98
> > Service Pack upgrade. Just a bad error message?
> >
> > Here are the stats:
> >
> > WinXP Pro
> > IE 6.0.28
> > MDAC 2.7
> > MSXML 4.0
> >
> > Has anyone seen anything like this?
> >
> > Thanks for your help.
> >
> > Joe Geretz
> >
> >
> >
>
>



Relevant Pages