ZMSQL Question lazarus / 16-Databases ---------------------------------------------------------------------- Foxy · 2012-12-12 11:58 Hi I downloaded latest ZMSQL components to do some tests. I made a cut down version of the demo apps with just one Table querying prdcts.txt and displaying it in a TDBGrid component. Design time Fields were defined with PRDCTS_ID defined as ftInteger, PRDCT_BASE_QTY as ftFloat and all other fields as ftString. At runtime the query is run, editable data is returned to the grid.  I made some edits and clicked a SaveToCSV button designed to save the table back to a Test.txt file.  Examination of this file shows my edits were posted but ALL fields in the file were "quoted" including the ftInteger and ftFloat fields. I understand that the JanSQL ancestor is ftString only based so ZM does some manipulation to allow Field defintions to be correctly typed.  I would have expected that either a) The data would be returned from ZM as supplied (regarding quotation) or b) the returned data would be correctly quoted depending upon the design-time field definitions.  Am I missing something here? ---------------------------------------------------------------------- tatamata · 2012-12-16 12:11 Please, check order and number of fileddefs in comaprisson to fields of a returned dataset from SQL query. if they don't match, zmsql treat all the resultes fields all as strings. Only if predefined fieldefs and query resultset match number and names, zmsql is able to treat them datatype wisely. if you suspect there is a possible bug, please consider to inspect SatveToCsv method. Regards, Zlatko ---------------------------------------------------------------------- Foxy · 2012-12-16 12:39 Hi Zlatko Thanks for your response. The problem occurs when using Capitalized FieldNames in the First Row of the CSV file. Lots of people do this to make their displaying grid component look nice without having to change the column titles collection in the Grid component. I found the problem in TZMQuryDataSet.InspectFieldDefs function The comparison if (vNewFieldNames = vOldFieldNames) will fail when comparing the uppercase string in self.FieldNames with the lowercase but same list coming back from sdJanSQL. Its failure will result in the use of janSQL's ftstring types being used for the return into the CSV file. I fixed it myself by UpperCasing both sides but I don't know if this will break things elsewhere. Please let me know if you approve the fix. Best regards Foxy ---------------------------------------------------------------------- tatamata · 2012-12-16 13:21 Hi, of course, I do agree, you are free to post new, updated zmsql package. This project I started to honor free pascal and everybody from community is free to improve it. Please, do include the bugs resolvments from the zmsql forum thread, that other members found meantime. After you do the new package version, please contact Vincent Snijders to include new package version in Lazarus CCR repository. Don't forget to comment your improvements. Thanks. ---------------------------------------------------------------------- Foxy · 2012-12-16 19:12 Hi Ziatko Thanks for your response.  I am new to this game. Please tell me where I can find the ZMSQL forum. I search in this forum and find no posts since 2011 and only 5 in total. Is there another forum I am missing? Also not sure what exactly to submit as an updated package. The effected source code, the whole package or what? best regards Martin ---------------------------------------------------------------------- tatamata · 2012-12-16 20:04 Hi, I ment a thread on this, Lazarus forum: www.lazarus.freepascal.org/index.php/topic,13821.60.html lazarus ccr download: http://sourceforge.net/projects/lazarus-ccr/files/zmsql/ and the wiki page: http://wiki.freepascal.org/ZMSQL You have to post the whole source in a zip file.