- Код: Выделить всё
Public Function GetRequestXML(ByVal RequestID As Long) As MSXML2.DOMDocument40
On Error GoTo Err_Debug
Dim XML As MSXML2.DOMDocument40
Dim cmd As ADODB.Command
Dim SQL As String
Dim sXSL As String
Dim s As String
100 SQL = "EXEC GetRequestXML " & RequestID
110 sXSL = GetXSL(RequestID)
If Len(sXSL) = 0 Then
Exit Function
End If
120 If Dir(App.Path & "\" & sXSL) = "" Then
Exit Function
End If
sXSL = App.Path & "\" & sXSL
140 Set XML = New MSXML2.DOMDocument40
150 XML.async = False
160 Set cmd = New ADODB.Command
170 cmd.ActiveConnection = modADO.GetConnectionString
180 cmd.CommandType = adCmdText
190 cmd.CommandText = SQL
200 cmd.Properties("XML Root") = "root"
210 cmd.Properties("Output Stream") = XML
220 cmd.Properties("Output Encoding") = "windows-1251"
230 cmd.Properties("xsl").Value = sXSL
240 cmd.Execute , , adExecuteStream
250 Set GetRequestXML = XML
'XML.Save App.Path & "\output\in_xml.xml"
lb_out:
260 Set cmd = Nothing
270 Set XML = Nothing
Exit Function
Err_Debug:
LogError "GetRequestXML", True
Resume lb_out
End Function
может кому пригодится