XML into a string

wxdqz

New Member
I have been trying to use XML as an alternative to disconnected ADO recordsetsto pass data between COM+ components. The SQL statements that will be processedin a worst case scenario will probably retrieve around 200,000 records butmore commonly 1 - 20,000 records. I am currently doing this by executingan SQL statement against SQL Server 2000 using ADO and the FOR XML clausein the SQL statement. Once I have the resultset in XML format because thisis seperated across several records in the ADO recordset, I am then doinga getrows to dump the contents of the recordset into a variant array. I thenloop through the array, writing to a sequential file the XML. Next I openthe sequential file using the DOM object and finally assign the XML to astring variable (e.g. str = domobject.xml). Although this sounds very convolutedI have found this to be so far the quickest way of getting the SQL resultsetinto XML format and in a string variable, for passing between components.Alternatives I have tried are building up the XML from the ADO resultset,directly into a string variable (e.g str = str & str). This is very slow.I have also used the DOM object to create the XML. This is still slower,but quicker than building up a string. Finally I have tried an ADO streamand assigned the output of the stream to the DOM object directly, then thexml to a string variable. This I hoped would be very quick - but it is slowerthan the first method. Does anyone know of a better method to get the resultsetof an SQL statement, into a string in XML format. My next problem will thenbe to get the same thing to work for Oracle. Does the same XML support existin Oracle as SQL Server e.g FOR XML in the SQL statement etc. Any help onboth of these problems will be much appreciated.
 
Back
Top