none
msxml6.dll: The filename, directory name,or volume label syntax is incorrect RRS feed

  • Question

  • msxml6.dll: The filename, directory name,
     or volume label syntax is incorrect.

    when i use the validation given in the script

    'Validate the data file prior to bulkload
    Dim sOutput

    sOutput = ValidateFile("c:\test\SampleXMLData.xml", "", "c:\test\SampleSchema.xml")

    WScript.Echo sOutput

    'If FileValid Then
       ' Check constraints and initiate transaction (if needed)
       ' objBL.CheckConstraints = True
       ' objBL.Transaction=True
      'Execute XML bulkload using file.

      objBL.Execute "c:\test\SampleSchema.xml", "c:\test\SampleXMLData.xml"
      set objBL=Nothing
    'End If

     


    Function ValidateFile(strXmlFile,strUrn,strXsdFile)
       
       ' Create a schema cache and add SampleSchema.xml to it.
       Dim xs, fso, sAppPath
       Set fso = CreateObject("Scripting.FileSystemObject")
       Set xs = CreateObject("MSXML2.XMLSchemaCache.6.0")
       sAppPath = fso.GetFolder(".")
       xs.Add strUrn, sAppPath & "\" & strXsdFile

       ' Create an XML DOMDocument object.
       Dim xd
       Set xd = CreateObject("MSXML2.DOMDocument.6.0")

       ' Assign the schema cache to the DOM document.
       ' schemas collection.
       Set xd.schemas = xs

       ' Load XML document as DOM document.
       xd.async = False
       xd.Load sAppPath & "\" & strXmlFile

       ' Return validation results in message to the user.
       If xd.parseError.errorCode <> 0 Then
            ValidateFile = "Validation failed on " & _
                 strXmlFile & vbCrLf & _
                 "=====================" & vbCrLf & _
                 "Reason: " & xd.parseError.reason & _
                 vbCrLf & "Source: " & _
                 xd.parseError.srcText & _
                 vbCrLf & "Line: " & _
                 xd.parseError.Line & vbCrLf
                 FileValid = False
        Else
            ValidateFile = "Validation succeeded for " & _
                 strXmlFile & vbCrLf & _
                 "======================" & _
                 vbCrLf & "Contents to be bulkloaded" & vbCrLf
                 FileValid = True
        End If
    End Function

     

     

    i get the above error , morover  i need to transfer data from SQL to XML with the tag elements specified in the schema file ie XSD file


    svk
    Tuesday, October 19, 2010 1:07 PM

Answers

  • Hi,

    Thank you for your post.

    Since this forum is only for SQL Server XML and your question is more related to VBScript, I recommend that you ask it in VBScript forum, so you can get more help. Please see:

    Visual Basic General

    Thanks,

    Ai-Hua Qiu


    Constant dropping wears away a stone.
    • Marked as answer by Ai-hua Qiu Thursday, October 28, 2010 9:23 AM
    Friday, October 22, 2010 9:08 AM