Jump to content

teri

Members
  • Content Count

    3
  • Joined

  • Last visited

Community Reputation

0 Neutral

Technical Information

  • Delphi-Version
    Delphi 11 Alexandria
  1. Hello - I wrote an application that uses a TFDQuery to retrieve data from a SQL Server. A few of the fields in the query are typed as TSQLTimeStampField. Everything works beautifully when I run the application, either from within the Delphi IDE or as a standalone app. However, when my colleague, who needs to use the application, tries to run it, she gets the following error. We're using version 2019 of SQL Server, and the data field in the SQL table is typed as DateTime2(0). I tried changing CollectionTime's field type to WideString then DateTime, but each threw Debugger Exceptions. I'm at a loss as to how to remedy this. Any suggestions? Teri
  2. teri

    TFDMemTable - how to clear structure?

    Thanks for the responses. I was actually clearing the dataset fdmColumnValues correctly, by clearing Fields and FieldDefs, but I had neglected to empty the fdmColumns dataset which I was using to define the field names. Thus, I was getting a duplicate field error. DOH! Teri
  3. teri

    TFDMemTable - how to clear structure?

    Hello - I'm having same/similar issue when I try to reuse a TFDMemTable to load varying column count csv files. I read in the csv's header, construct the table fields then create the table. The second time it's run, I get a duplicate FieldDef error. fdmColumns is a TFDMemTable containing the list of column headings. fdmColumnValues is the TFDMemTable I want to load the contents of the csv file into. What am I missing? Teri procedure DefineTable; begin fdmColumns.First; fdmColumnValues.Free; fdmColumnValues := TFDMemTable.Create(self); while not fdmColumns.eof do begin with fdmColumnValues.FieldDefs.AddFieldDef do begin Name := fdmColumns['ColumnName']; DataType := ftString; end; fdmColumns.Next; end; fdmColumnValues.CreateDataSet; dsColumnValues.DataSet := fdmColumnValues; end;
×