Jump to content

rvk

Members
  • Content Count

    135
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by rvk

  1. rvk

    Firebird3- Active and InActive ALL Triggers

    Was this still possible in the latest Interbase version??? For Firebird 3+ at least, directly updating the RDB$TRIGGERS isn't allowed anymore. See the comment here: https://gist.github.com/martinusso/1278962/07650568e3e71cb369dba68562a1e69e7fc4ba33 You could try the EXECUTE BLOCK mentioned there. (I didn't test this) (Inactivating. Activating could be done similarly) SET TERM ^ ; EXECUTE BLOCK AS DECLARE VARIABLE NOMTABLE varchar(100); DECLARE VARIABLE REQ1 Varchar(100); BEGIN for select x.RDB$TRIGGER_NAME from rdb$triggers x where rdb$trigger_source is not null and (coalesce(rdb$system_flag,0) = 0) and rdb$trigger_source not starting with 'CHECK' into :NOMTABLE do begin NOMTABLE=trim(NOMTABLE); req1= 'ALTER TRIGGER ' || :NOMTABLE || ' INACTIVE;'; execute statement req1; end END^ SET TERM ; ^
  2. rvk

    Sending Email via GMail Using OAuth 2.0 via Indy

    Glad it works now 👍
  3. rvk

    Sending Email via GMail Using OAuth 2.0 via Indy

    I just tested your messsage.txt and it works for me. I can create a draft with that message but I can also directly send it (because I have both draft and send access in my app approval). This is my code. (Although I would remove the headers From, Reply-To and Date because those would be added automatically. It doesn't hurt when you add them but they are NOT used. From is always the address of the default sender in gmail and Reply-To is always the gmail account and Date is always now.) Looking at your code I now do see a difference with my code. You are using Url := 'https://gmail.googleapis.com/gmail/v1/users/' + emailFrom + '/messages/send'; I'm using Url := 'https://www.googleapis.com/upload/gmail/v1/users/' + gOAuth2.email + '/messages/send'; You need to use the Upload URI, for media upload requests to post this as raw message. See here https://developers.google.com/gmail/api/reference/rest/v1/users.messages/send There is a difference with /gmail/v1 and /upload/gmail/v1. If I use your Url I also get an invalid JSON error message 400. So use the other Url and it should be fine.
  4. rvk

    Sending Email via GMail Using OAuth 2.0 via Indy

    Btw. It's best you first try a very simple rfc822 style message without attachment. If that works you can debug why adding attachments doesn't work. You can post the simple message here if it doesn't work for you so we can debug it. (i.e. wrong headers due to not disabling escaping mail adresses)
  5. rvk

    Sending Email via GMail Using OAuth 2.0 via Indy

    Can you post the raw rfc822 data in a txt file here with a simple testmail? (Did you try the overloaded saveto helper to disable escaping email adresses as suggested??) I can try it here to see what goes wrong. The rfc822 mimetype should work with send-api too (i thought). I also found that the error messages you get are indeed often unhelpfull (just a 4xx rejected without reason). Another option is just plain smtp with a specific app-password. But that's something each user should set in their own account (and provide your app with that password). Using the authetication method is much easier. Downside is that your app needs to go through the approval process of Google for the specified access.
  6. rvk

    Sending Email via GMail Using OAuth 2.0 via Indy

    For posting a draft message to GMail I don't need any JSON. I can just post the complete mail (eml-format) to https://www.googleapis.com/upload/gmail/v1/users/<email-adres>/drafts. You do need to set the header Authorization: Bearer with the correct access_token. Ps. My MimeType (with Synapse) is message/rfc822 and accept is application/json. I don't see that in your code. Small snippet from my code (as I said with Synapse). The CreatePlainEML creates a mail message which is compatible with Outlook Express and Thunderbird (I believe this is the rfc822 e-mail standard). With TMimemess and multiple TMimepart parts followed by the TMememess.EncodeMessage-function from Synapse. So there shouldn't be any need for posting JSON (only retrieving the result as JSON). I don't think TIdMessage creates a much different text but I'm not sure.
  7. Do you see the cpu for "Antimalware Service Executable" process skyrocketing when you compile in D7? Did you try disabling some of the "Exploit protection"-settings (i.e. CFG and DEP) of Defender? (Setting > Security > App & Browsercontrol > "Exploit protection settings" at the bottom) If that works you can enable it again and only exclude your processes from it.
  8. rvk

    Could not load OpenSSL library.

    If your application is 32bit you also should use the 32 bit dll's. Not the x64 bit ones. Putting them in your exe directory and not using IdOpenSSLSetLibPath should also work.
  9. At the moment Google probably has marked the download as safe because it is downloaded multiple times. In the future, if Crome is blocking the download with only a discard option, you can go to "Downloads" page of Chrome and there should be an option to keep the download.
  10. rvk

    Could not load OpenSSL library.

    Did you download the 32 bit version or the 64 bit ones? The DLL bitness must match your programs bitness. There shouldn't be any need to set the IdOpenSSLSetLibPath. But if you want to set it, you can do it with: Initialization IdOpenSSLSetLibPath(ExtractFilePath(Application.ExeName));
  11. rvk

    Delphi on Windows 10 HOME 64-bit?

    Those licenses could also be revoked after some time by Microsoft. You will never know beforehand. https://www.howtogeek.com/392080/cheap-windows-10-keys-do-they-work/
  12. rvk

    Sending Email via GMail Using OAuth 2.0 via Indy

    This should have no impact for application passwords. Your application doesn't even need to be changed. Just use the application password instead of the regular GMail password.
  13. rvk

    How to use library from Delphi 10.1 DCUs in Delphi 10.3.3?

    You don't need LoadLibrary/FreeLibrary if you use a static function definition like "external myDLL". So use either LoadLibrary/GetProcAddress/FreeLibrary or use function/external myDLL. Also... you use a string as parameter. That is a managed type. I'm not sure but that might give you problems.
  14. Ah, yes. But Dmitry gave an example of SelectQuery.Transaction := ReadTransaction; So I was talking about setting the actual transaction properties rather than talking about the fact the transaction-property itself is used or not. It indeed seems to be that some of the explicit transaction assignments only work for Interbase/Firebird (???). Also for the transaction of a TDataset: http://docwiki.embarcadero.com/Libraries/Rio/en/FireDAC.Comp.Client.TFDRdbmsDataSet.Transaction How would one set transactions with specific isolation level for MSSQL and Oracle then ??? Doesn't FireDac support these? This page does mention setting isolation level but also mentions it is for Firebird/Interbase. http://docwiki.embarcadero.com/RADStudio/Rio/en/Managing_Transactions_(FireDAC) (FireDac might be even more rubisch than I initially thought if you can't set isolation level etc for other databases via the standard property)
  15. As long as you use the standard properties and values to set the isolation levels etc., they will work for all databases. Most databases have transactions and you should be able set them the same way. i.e. MSSQL and Oracle etc. all have Read Committed transactions levels. So transactions work the same way. Only when setting special properties via the params, you'll get database specific.
  16. By setting the correct isolation level, record version and wait-option for the transaction. https://ib-aid.com/en/how-to-track-deadlocks-in-firebird/ As I said I'm not familiar with FireDac so I'm not sure how to set it. https://stackoverflow.com/a/56337589/1037511 (Something like read_committed, rec_version and nowait should fix deadlocks on select)
  17. For good measure I would add Connected := false after dbQuery.ExecSQL; (But my guess this is also done in dbConn.Free) dbQuery.ExecSQL; dbConn.Connected := false; But I see you update the table in the thread. You didn't do that in your original post. The deadlock can come from using transactions incorrectly (or updating the same record in different transactions/threads), http://www.firebirdfaq.org/faq151/
  18. It's not if you're using a pool. When using a pool the connection is given back to the pool. It's not closed. At least that's what the documentation says. http://docwiki.embarcadero.com/RADStudio/Rio/en/Multithreading_(FireDAC) But maybe the TFDConnection.Free already does that. What's your code like now?
  19. Maybe putting a amNonBlocking in there? FDQuery1.ResourceOptions.CmdExecMode := amNonBlocking; You're not updating anything so I'm not sure why there would be a deadlock there. You set the TFDConnection.Connected to false afterwards in the thread? (because that releases the connection back to the pool)
  20. rvk

    Duplicate resource, but strange...

    Yes, that sometimes happens to me too. Often this is due to the IDE not recognizing some lines and not knowing it already has a {$R *.res} line. Sometimes reordering the uses-units and other elements will fix this (if it keeps happening). (I had to move my {$R} lines above the uses- and {$SETPEFLAGS} lines.)
  21. rvk

    Duplicate resource, but strange...

    Look in your project source (the .dpr file)... do you have multiple {$R *.res} lines?
  22. I have no experience with FireDac, but shouldn't you create a TFDConnection in each thread to be used with TFDQuery? As is shown in http://docwiki.embarcadero.com/RADStudio/Rio/en/Multithreading_(FireDAC)
  23. rvk

    Add a system-menu item to all applications?

    I'm not sure but there might be a way to do it from one exe. But that might be really advanced stuff (haven't looked st the details). https://blog.mattmags.com/2007/06/30/accessing-32-bit-dlls-from-64-bit-code/
  24. Because with older Android version the permission is given during install (if it's asked for by the program). With newer Android the permission needs to be given during runtime (because during install everybody just clicks through without thinking).
  25. If you set the proper permission in the manifest you might be able to manually 'activate' that permission in the permission section of the App-settings in Android (instead of asking this via your program). (But for a production program it is best to ask for it in the program itself)
×