Jump to content

weirdo12

Members
  • Content Count

    99
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by weirdo12

  1. weirdo12

    Send multiple attachments with smtp.office365/outlook.com

    Thanks, Remy. That's the answer I expected and what I had already told the customer. I really hesitated asking the question but thought I better before telling the customer they'd need to contact Microsoft.
  2. weirdo12

    New Firebird 4 datatype "TIMESTAMP WITH TIMEZONE"

    https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Connect_to_Firebird_(FireDAC)
  3. If you use a suitable column type alias in your SQLite table definition, FireDAC will figure out the correct field data type to use. DATE | SMALLDATE dtDate DATETIME | SMALLDATETIME dtDateTime TIMESTAMP dtDateTimeStamp TIME dtTime https://docwiki.embarcadero.com/RADStudio/Alexandria/en/SQLite_support_in_RAD_Studio
  4. Do you need to store exit_time value as INTEGER or would you prefer it stored in a format that you can read (like yyyy-mm-dd)?
  5. weirdo12

    SQLite Delphi 11 Community Edition

    If you do want to use the latest version of SQLite, make sure to change the EngineLink property of your TFDPhysSQLiteDriverLink component to slDynamic and put the SQLite DLL in the same directory as the application exe.
  6. To use the example as shown, DataObject would be a type that has an overloaded assignment (Assign) operator that accepted a TDataSet (or TFDQuery or whatever). In Assign you would copy the data you want to the members of DataObject. https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Operator_Overloading_(Delphi)#Declaring_Operator_Overloads
  7. Have a look at SQLite as Anders suggested: https://sqlite.org/appfileformat.html
  8. weirdo12

    Trap TFDConnection error on data module create etc?

    Was that meant as a dis of SQLite - did I read that right?
  9. weirdo12

    Trap TFDConnection error on data module create etc?

    If you are using components built specifically for Interbase/Firebird (or some other server) - absolutely.
  10. weirdo12

    Trap TFDConnection error on data module create etc?

    Okay that is a good reason to stick with what your using.
  11. weirdo12

    Trap TFDConnection error on data module create etc?

    Would you consider changing to SQLite? I know it might be a huge deal if you have a lot of database specific dependencies in your code so it might not be practical.
  12. weirdo12

    Trap TFDConnection error on data module create etc?

    Someone would have to write an IDE plugin.
  13. weirdo12

    Trap TFDConnection error on data module create etc?

    No, I would say the file is already in use. Maybe you have no choice but to make sure the IDE closes the connection before you run your app. The IDE and your app can't both use the file. That's a different problem and it won't be solved by ConnectedStoredUsage. But if your want you app to always start with the Connected = False outside of the IDE it will make sure that happens.
  14. weirdo12

    Trap TFDConnection error on data module create etc?

    Please try using the ConnectedStorageUsage property and save yourself all that hassle. You can have you cake and eat it too. Just uncheck uaRunTime and the TFDConnection.Connected property will never be True at runtime even when you save your unit with it set to True.
  15. weirdo12

    Trap TFDConnection error on data module create etc?

    I'm glad you gave it a try!
  16. This works in RAD Studio 11.3 with PostgreSQL 14.8 running on Ubuntu. Without the SET search_path code, the table is always being added to public even if SchemaName was set to dba or if the TableName was qualified like dba.test_table. std::unique_ptr<TFDTable> vTable(new TFDTable(0)); vTable->Connection = db_connection; vTable->TableName = "test_table"; vTable->FieldDefs->Add("login", ftLargeint, 0, true); vTable->FieldDefs->Add("ticket", ftLargeint, 0, true); vTable->FieldDefs->Add("exec_time", ftDateTime, 0, true); vTable->FieldDefs->Add("req_price", ftFloat, 0, true); TFDIndex* idx = vTable->Indexes->Add(); idx->Name = System::Sysutils::Format("%s_pkey", String("test_table")); idx->Fields = "login;ticket"; idx->Active = true; db_connection->ExecSQL("SET search_path TO dba, public"); if (!vTable->Exists) { vTable->CreateTable(False); } db_connection->ExecSQL("SET search_path TO public, dba");
  17. weirdo12

    Trap TFDConnection error on data module create etc?

    If both of those are False the state of Connected will be ignored. You can test this by setting Connected to True, saving the file, closing it and reopening it. Connected will be False. Or create a new app. Drop a TFDConnection component on the main form. Set DriverName to SQLite. Add a BeforeConnect event handler. Put some dummy code in it so it does get deleted because it's empty. Set a break point on it. Set Connected to True. You should get prompted for a password. Click OK. Now run the app. The breakpoint won't occur. Now check auRunTime. Run the app again. It will break at the BeforeConnect event handler.
  18. weirdo12

    Trap TFDConnection error on data module create etc?

    There is an TFDConnection property that you can set to tell it how use/save the state of the Connected property - ConnectedStoredUsage.
  19. Did you try including the schema name with the table name? vTable.TableName:='test_schem.test_table';
  20. If you use the public schema does everything work as expected? I just want to confirm that. I am assuming it does. You don't assign any value to SchemaName and everything works. Or do you assign 'public' to SchemaName?
  21. weirdo12

    Retrieve count values on different columns

    Nice. The only issue would be if any of the columns is NULL.
  22. Have you tried this setting? It's just a shot in the dark.
  23. weirdo12

    Retrieve count values on different columns

    Or: SELECT SUM( if( (if(col1 = 'True', 1, 0) + if(col2 = 'True', 1, 0) } + if(col3 = 'True', 1, 0) ... ) > 0, 1, 0) ) AS "Some Columns Have True Strings" FROM ...
  24. weirdo12

    Retrieve count values on different columns

    How about: SELECT if(col1 = 'True', 1, 0) + if(col2 = 'True', 1, 0) } + if(col3 = 'True', 1, 0) } ... AS "Sum Of True Strings" FROM ...
×