« Previous Next »

Thread: Asking LogParser to do the impossible

Last post 02-14-2007 7:41 AM by LogParser User : StanL. 0 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (1 items)

Sort Posts:

  • 02-14-2007, 7:41 AM

    Asking LogParser to do the impossible

    Generating an xsd validation file is easily accomplished in .NET with a DataSet Object. You can use XMLExport in Access 2003 but that is specific to Access Tables; then there is SQLXMLOLEDB which only worls with SQL Server.

    Prior to .NET, the MsPersit provider permitted creating .xml files from either disconnected or fabricated recordsets. The xsdtest.xml [attached] is persisted from a fabricated recordset. Microsoft has an xsd.exe utility that will output an xsd file for an xml file, but hiccups badly if passed the xsdtest.xml - that is because persisted recordsets have their own schema embedded.

    So


    cSQL = "SELECT * into c:\temp\xsdtest1.xml FROM c:\temp\xsdtest.xml"
    oLog = CreateObject("MSUtil.LogQuery")
    oLog.maxParseErrors = 100
    oInput = CreateObject("MSUtil.LogQuery.XMLInputFormat")
    oOut = CreateObject("MSUtil.LogQuery.XMLOutputFormat.1")
    oOut.structure=4
    oOut.rootName="Input"
    oOut.schematype=1
    oOut.filemode=1
    oLog.ExecuteBatch(cSQL, oInput, oOut)

    will output xsdtest1.xml which can be parsed by xsd.exe - but the results do not reflect the 'fields' [xsdtest.xsd]. I've played around with the output settings, and admit it gets over my Pooh Brain... but the goal is [hopefully] admirable - 'for any database structure persisted as a recordset, create a basic xsd validation file w/out .NET i.e. VB. VBA or scripting code.

    Hope this makes sense Stan

Page 1 of 1 (1 items)
Microsoft Communities