tquery

Delphi TQuery save to csv file

纵然是瞬间 提交于 2020-01-01 02:48:05
问题 I want to export content of a TQuery to a CSV file without using a 3d part component(Delphi 7). From my knowledge this can not be accomplished with Delphi standard components. My solution was to save the content in a StringList with a CSV format, and save it to a file. Is there any comfortable solution? PS:I don't want to use JvCsvDataSet or any component. Question is: can this be accomplished only with Delphi 7 or higher standard components? Thank you in advance! 回答1: Of course it can. You

How can I query a value in SQL Server TEXT column that contains XML (not xml column type)

南楼画角 提交于 2019-12-10 20:31:04
问题 I have table DOCUMENTS with: DOCUMENTS ____________________ DOCUMENTID int USERID int CONTENT text I have following XML stored in TEXT column with name CONTENT in a SQL Server database <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <IDMSDocument> <DocumentContent> <Attribute Name="Number" GUID="{FFFFFFFF-0000-0000-0000-000000000001}"> <IDMSType>3060</IDMSType> <Value Type="Integer"> <Value>122</Value> </Value> </Attribute> <Attribute Name="Date" GUID="{FFFFFFFF-0000-0000-0000

Delphi: TAdoQuery Memory Leak?

一笑奈何 提交于 2019-12-08 08:21:48
问题 I'm developing as small diabetes program using Delphi 5 and ADO. I do a little query like this: function GetLowestGlucoseLevel(StartDate:string;EndDate:string): Integer; var Q:TADOQuery; begin try Q:=TADOQuery.Create(Application); //Separate unit, owner set to App Q.Connection:=dtMod.ADOCon; Q.DisableControls; Q.Close; Q.SQL.Clear; Q.SQL.Add('SELECT Min(qGlucose.Glucose) AS MinOfGlucose from qGlucose'); Q.Parameters[0].Value:=StartDate; Q.Parameters[1].Value:=EndDate; Q.Open; Result:=Q

Delphi: Paradox DB Field Name Issue (Spaces in field name)

此生再无相见时 提交于 2019-11-28 07:34:31
问题 I have a paradox table from a legacy system I need to run a single query on. The field names have spaces in them - i.e. "Street 1". When I try and formulate a query in delphi for only the "Street 1" field, I get an error - Invalid use of keyword. Token: 1, Line Number: 1 Delphi V7 - object pascal, standard Tquery object name query1. 回答1: You need to prefix the string with the table name in the query. For example: field name is 'Street 1', table is called customers the select is: SELECT