views:

155

answers:

2

I have written an application that allows a user to create and run a query, then save the report to file. They can load the report from file at a later date and view on screen.

I use a TADOQuery component to run the query, and call SaveToFile when the query has returned data. I then use LoadFromFile to load the data back into a TADOQuery and from there, I can read the data into a virtual listview. In both cases, I am specifying "pfXML" as the format parameter.

A user has reported a problem whereby one of the fields in the report is displaying garbage instead of readable text. Upon investigation, the field definition in their xml document for that particular field is specified as "dt:type='bin.hex'". When I run the same query on a system here, the field definition in my xml document is specified as "dt:type='string'".

My question is therefore why is there a difference? The databases are identical, so why is the data being saved as bin.hex on the user's system and as a string on everyone else's? Perhaps more to the point, how is the data type determined? When I call SaveToFile, how does the TADOQuery component know what the data type is, and what it should write to the xml document as the data type?

Is it that the data is being sent back to the PC in hex format, and the TADOQuery component is taking its cue from that, or does it (for some reason) think that the data type for that field is hex and it changes the data to suit?

I can't find anything online about this and I can't work out what's going on, so any help would be appreciated.

A: 

At 1st glance, sounds like a unicode/char encoding to me.

François
A: 

It seems that this has something to do with how the server is set up. We have only had the problem at one customer site and on a very old version of OS400 (the queries run over DB2 databases).

Jeedee