Quote:
quote:Originally posted by bmains
I created this script to be used in a DTS package:
Code:
set objConn = CreateObject("ADODB.Connection")
objConn.Open(m_strConnectionString)
set objCmd = CreateObject("ADODB.Command")
set objCmd.ActiveConnection = objConn
objCmd.CommandText = "xmlSelectData"
objCmd.CommandType = 4
set objStream = CreateObject("ADODB.Stream")
objStream.Open
objCmd.Properties("Output Stream") = objStream
'adPersistXML
objCmd.Execute , , 1
strXML = objStream.ReadText
'... Close objects
But the file contains no XML when written out to the file. Is this correct?
|
Code:
objCmd.Execute , , 1
should be
Code:
objCmd.Execute , , 1024 'adExecuteStream
and instead of reading the stream to a string, which can break any encoding you should use saveToFileMethod.
--
Joe