Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 9th, 2004, 04:38 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

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
 
Old March 9th, 2004, 09:31 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Thanks, that fixed it.





Similar Threads
Thread Thread Starter Forum Replies Last Post
help - EXSLT func cannot set more than one result! anboss XSLT 1 October 28th, 2008 02:17 PM
getting a result set to a vector cakalanka Java Databases 1 March 24th, 2008 07:33 AM
Please help my code is not giving me a result set yudee JSP Basics 0 September 20th, 2006 09:55 AM
Result set jemacc SQL Server 2000 0 December 19th, 2003 07:26 PM
Using a SP result set in a FROM clause Bernard Omiple SQL Server 2000 1 October 3rd, 2003 05:38 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.