Hello,
I am working on a VB6 application that uses an ADODB.Recordset object to dump data to an .xml file with the 'save' method, like the following:
adoRecordset.Save strDst, adPersistXML
where strDst is a string describing the destination.
Now, there are some rows in the database that are floats/doubles, for some table. For example, the table TABLE contains a column MEASURE of type float.
Question: Is it possible to control the presision of MEASURE that is written to the .xml-file?
For example, if the measure is 1.23456789 is it possible to have measure="1.234" in the output file?
Idea: The ADO record set has a collection 'Fields' of type 'Field' for each record of the database. The property 'Precision' for the fields exists but is 'mostly' read-only. It is pretty unclear when it can be written by looking at the help from MSDN. Can it be used somehow?
Restriction: I do want to use the 'Save' method. I want to know if it is possible with it in order to avoid writing my own method.
Background: The aim is to transfer a huge amount of data extracted from the database over a long distance channel to another system. In that system, the data is loaded into a database for preliminary analysis. The bottlenecks are the channel and the existing application for data extraction which selects the tables to be transfers via some algorithm. The .xml files are zipped with a high compression rate but the amount is still too much so that we decided to drop some not so important data.
Side problems (referring to onedaywhen's solution) Thanks onedaywhen for you answer up to now. I use it slitly differently, but it already helped a lot (+1). The problem that appear is that most of the values are well rounded at the desired position, but when it is written to the .xml, there is a kind of binary to decimal conversion error. e.g. 3.123 becomes "3.1230000000000002".