Hi,
I'm working with VB6 (sp3).
And I found a weird problem when trying to save a recordset as XML file.
1. Create a recordset, load data in it and filter on a subset of rows.
--------------------------
----------
----------
----------
----------
------
dim rs as ADODB.Recordset
dim rsCopy as ADODB.Recordset
....
2. Copy the filtered rows (not clone)
--------------------------
----------
----------
----------
----------
------
dim strm as new ADODB.stream
Set strm = New ADODB.stream
rs.Save strm
rsCopy.Open strm
3. Updates a row
--------------------------
----------
----------
----------
----------
------
rsCopy.MoveFirst
For i = 0 To rsCopy.Fields.Count - 1
'replace null value by an empty string
rsCopy.Fields.item(i).Valu
e = "" & rsCopy.Fields.item(i).Valu
e
Next i
4. Save as XML file
--------------------------
----------
----------
----------
----------
------
rsCopy.Save "C:\Test.xml", adPersistXML
5. Open the XML file
--------------------------
----------
----------
----------
----------
------
you see the update.... and this format is not supported by crystal report...
...
<rs:update>
<rs:original>
<z:row OID='17900' c1='' c2='Mar 29 2004 3:17PM' c3='' c4='' c5='' c6='' c7='' c8='' c9='' c10='' c11=''
c12='' c13='' c14='29-17-04' c15='' c16='' Usuario='' c18=''/>
</rs:original>
<z:row OID='17900' c1='' c2='Mar 29 2004 3:17PM' c3='' c4='' c5='' c6='' c7='' c8='' c9='' c10='' c11='' c12=''
c13='' c14='29-17-04' c15='' c16='' Usuario='' c18=''/>
</rs:update>
<z:row OID='17910' c2='Mar 29 2004 3:17PM' c14='29-17-04' Usuario='' c18=''/>
...
6. Why I replace null value by an empty string ?
--------------------------
----------
----------
----------
----------
------
This is because I use the XML file as source for my Crystal reports. And the columns containing null values are not
exported in the XML file...
7. Any solutions ???
--------------------------
----------
----------
----------
----------
------
- How to avoid to keep trace of the update ?
or
- How to export the column with only null value in the XML file ?
Start Free Trial