Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. Henry Olive

    SQL Update

    Thank you so much Vandrovnik, Attila
  3. Today
  4. Attila Kovacs

    SQL Update

    I don't know IB nor do I know the result of the IM JOIN WH but I don't like the "SUM(IM.TRS)TRS" I would write this like ISNULL( SUM( ISNULL(IM.TRS, 0) ), 0) AS TRS
  5. Vandrovnik

    SQL Update

    May be instead of SELECT SUM(IM.TRS)TRS, SUM(IM.INCOME)INCOME, SUM(IM.OUTGO)OUTGO should be just SELECT SUM(IM.TRS), SUM(IM.INCOME), SUM(IM.OUTGO) ? The JOIN - I alway specify what kind of join I want, such as LEFT OUTER JOIN, because I am never sure, what is the default 🙂
  6. Henry Olive

    SQL Update

    I wish everyone a healthy day i want to UPDATE a stock quantities with below S.Proc i dont get any err. msg. but this sql doesnt update correctly ALTER PROCEDURE "UPDATEITEMQTY" ( "ITMNO" VARCHAR(20)) AS declare variable TRS NUMERIC(18, 5); /* Qty Transfer from last year */ declare variable INCOME NUMERIC(18, 5); /* Stock IN */ declare variable OUTGO NUMERIC(18, 5); /* Stock OUT */ BEGIN SELECT SUM(IM.TRS)TRS, SUM(IM.INCOME)INCOME, SUM(IM.OUTGO)OUTGO FROM ITEMMOVEMENTS IM /* IM=a VIEW & every item movements are CORRECT */ JOIN WHOUSE WH ON WH.WHNO=IM.WHNO WHERE ITEMNO=:"ITMNO" and WH.WHTYPE <>'Rework' INTO :TRS,:INCOME,:OUTGO; UPDATE ITEMS SET /* IB2007 has Coalesce problem so i wrote below code */ TRS= Case When :TRS >0 then :TRS else 0 end, INCOME= Case When :INCOME >0 then :INCOME else 0 end, OUTGO= Case When :OUTGO >0 then :OUTGO else 0 end, STOCK= (:TRS + :INCOME) - :OUTGO WHERE ITEMNO=:ITMNO; END Can someone help me please ? Thank You
  7. David Schwartz

    Is anybody working with TMS WebCore non-visual libs?

    1) They're delivered as part of the WebCore release and they are not otherwise distinguished as to their origin or who to contact with questions. So I contacted the only obvious people to reach out to. What else would you suggest? 2) I got no reply from the first post, and eventually something from the second. I don't know why nobody replied to the first one, but I can't remember ever NOT getting a reply to support tickets sent to TMS -- if not from Bruno, then someone else. When I have problems with anything from TMS, I know I can count on getting an answer. I've had some really crazy issues come up over the years, and Bruno has always come through, even if it took a while. Even in cases I figured were hopeless, Bruno always showed up with an explanation, if not a remedy. That said, a guess was offered that, if it had been actually tested, would have shown it wasn't viable. These libraries were delivered with not one hint of documentation, tests, or demos. But Bruno did finally respond saying he contacted the pas2js people and they confirmed there was a problem in the translation, that it has been fixed, and they will issue an update in the next release. Yay Bruno! Regardless, without any other knowledge or information, I posted something here simply because I was curious if anybody else has used these libraries and was able to get them to work. This seems like a fair thing to do, especially if the folks who delivered them aren't able to help. I do appreciate the fact that somebody went to the trouble to translate these libraries and that they're more like "quick and dirty" code ports than actual products. If you have a tool that can do that with a few mouse clicks, why not? But even one simple test unit created to verify that the resulting code compiles and runs would have saved a lot of headaches in this case. I did spend most of a day trying to figure this out before reaching out to anybody. Maybe I'm the only person actually using these libraries. I don't know. Nobody else has raised their hand yet and said one way or the other.
  8. Dany Marmur

    Database app good practice

    You can start by tring to... - Create a TDataModule and drop some TDataSets (you DACs queries) on it. - Put TDataSoures on a TFrame and link them to the TDataModule. - Put the TFrame on a form and link the forms buttons to the frames TActions. ...and see what happens (but create a small test project). The frame has the datamodule in interface uses, the form has the frame in interface section uses. When the number of datamodules and frames increase, a lot of component suites has "Link" components. You can, for example, if it suits your needs put a ConnectionLink component on the second... third... TDatamodule and link it to a singular Connection component. ... Primoz's books are great!! There's also "MVVM in Delphi- Architecting and Building Model View ViewModel Applications" but it will not speak of the TDataset based "model". They differ too much IMHO.
  9. David Heffernan

    String into TArray<Byte>

    In that case why convert to bytes? Not sure why we are guessing. Perhaps @karl Jonson might like to contribute.
  10. FPiette

    encrypt a date field in delphi??

    A Delphi TDateTime is just a floating point number given the number of day from Dec 31, 1899 (That date is 0). You can store the DateTime as a float or if your are not interested in the time, you can store Trunc(MyDateTime) as an integer and then convert that integer back to TDateTime using a cast. Of you want to obfuscate it a little bit more, you can add a constant before storing and subtract it after reading. And there are many other obvious way to obfuscate a TDateTime once you understand it is a simple floating point number: you can do whatever math you like on it before storing and do the inverse math when reading back. You lust pay attention to the precision of the math to not loose time when computing (Maye be use Extended and do some testing).
  11. Ian Branch

    encrypt a date field in delphi??

    Hi Team, D10.4.1. 32bit Apps. I have the need to disguise a Date in a table, currently stored as a Date field, so the actual date cannot be read by any normal User/Utility. Ideally, something to encrypt and decrypt as required. Doesn't need to be super secret, it's just to deter the casual 'hacker'. Currently the Date is stored in a Date field but this is not compulsory. Having said that, it will need to encrypted from a TDateTime (Now), and decrypted back to a TDateTime variable. Thoughts, suggestions, recommendations appreciated. Regards & TIA, Ian
  12. Darian Miller

    String into TArray<Byte>

    It was a simple example and the Encoding is selectable, but it really depends on what you are going to do with those TBytes... If you are getting it from Edit1.text as in the example, fidding with the bytes somehow, and then shoving it into Edit2.text, why convert to UTF8?
  13. Remy Lebeau

    String into TArray<Byte>

    TEncoding.Unicode represents bytes in UTF-16LE format. VERY RARELY will you ever need to use TEncoding.Unicode (or TEncoding.BigEndianUnicode) in real production code. Most uses of Unicode<->byte conversions involve converting between Unicode and UTFs, or Unicode and charsets. So, it is much more common to use TEncoding.UTF8, TEncoding.Default (TEncoding.ANSI on Windows, TEncoding.UTF8 on POSIX platforms), or TEncoding.GetEncoding(<charset>).
  14. Remy Lebeau

    Catch details on AV

    Agreed. And believe me, it has been requested many many times, but for whatever reason Embarcadero has continued to decide not to provide it.
  15. Remy Lebeau

    Byte Array to String

    Better to use SysUtils.TEncoding.GetString(), then no intermediate AnsiString is needed. procedure TForm1.Button1Click(Sender: TObject); var ANameSpace : Variant; AFolderItem : Variant; AMailItem : Variant; RTFBody : array of Byte; RTFString : String; begin OutlookApplication1.Connect; ANameSpace := OutlookApplication1.GetNameSpace('MAPI'); AFolderItem := ANameSpace.GetDefaultFolder(olFolderInbox); AMailItem := AFolderItem.Items(1); RTFBody := AMailItem.RTFBody; RTFString := TEncoding.Default.GetString(RTFBody); Memo1.Lines.Add(RtfString); end;
  16. Good suggestions! At this moment this was a test of micro benchmarking, and if similar concept is applied to multiple methods, it might bring some more than micro improvements. Of course this is not a 'let me test this quickly in 1h and know the results'... it will take time and results might not be what I was hoping for, or I might be surprised and it turns out to be big overall improvement. 🙂
  17. Yesterday
  18. emailx45

    getting started question: ToGo or Local

    if you world is C, then CBuilder! Object Pascal (Delphi) would be very easy for your xperience!
  19. Dany Marmur

    How to optimize exe loading times

    I don't know where to start... Thank you all for you comments! @Clément, this is a new project. I have been at it for 3 years 🙂 It will become OpenSource when i have finished the work with the current client, then all can scrutinize. It is a 3-tier system, so during exe startup, no datasets are activated, but a lot of resources are loaded. DevExpress multi-record controls and layouts can be loaded with all datasets active = false (!) so first the user sees the layout and can select tabs and then the user can "load/activate data". It's really very nifty. Data activation and loading are well tuned so it's almost looks like activating memdatasets, even over 4G. Thing is i have made it a "portable install" (because of some client needs) and as such trying to maintain "one exe only" (this is of course one issue in this context). So, to answer @Mahdi Safsafi too, no dll's at all. I have not had the time to check with a profiler yet. I'm sure i will reach lots of conclusions... and i will revisit this thread. 10-4. /Dany
  20. bobD

    getting started question: ToGo or Local

    Don't know if I provided too much context or not enough. I've got a pretty good idea what's slowing down the wifi, but not really interested in that, because (1) the unit router actually belongs to the apartment building. It's single band 2.4, but more than adequate for most purposes, and more importantly (2) this is mostly just an excuse to learn more about IB and FireDAC. I worked professionally against SQLServer for well over a decade, mostly dbGo, but also ODBC and (many years ago} BDE. But I never had the occasion to write a briefcase app: all strictly C/S. Since I'm retired now I have time to learn IB and FireDAC. What I didn't see in the Rad Studio samples is a pair of clear examples of the difference between setting up a Delphi FireDAC app to run IB embedded vs IB desktop. Is that a matter of FireDAC connection settings? Specific files in the connection datamodule uses clause? Some specific FD physical layer support component? I can easily set up a local IB connection, but since my dev machines have a local IB server running, I can't say for sure I know whether it's embedded vs desktop. I want to get the connection options completely sussed before moving into all the other new (to me) IB/FD goodies bobD
  21. What Angus said is correct. Personally I never use OnError. I check the error code on all event handler and all method calls, and use OnBgError for the rest.
  22. Not reliable: several clients can be behind a single IP. For example when there is a proxy or a modem/router: The server see the public IP address for all clients.
  23. Angus Robertson

    how to Properly check if Twsocket Tcp client is still connected ?

    In TWSocket, most errors are reported to event handlers, where 0 means no error. OnSocksError should only relate to proxies, so you don't need that. onBgException is for errors for which there no event handler involved, background message handling, etc. If OnError is assigned, it stops an exception being raised for some errors, like send data failing, so you need to check function return codes carefully. Angus
  24. Oh so 20's: Today, I say "Alexa, kill bill" Next year, I think: "GPT-3, optimize Windows and solve my customer Scott's code issues"
  25. Dmytro Lendel

    how to Properly check if Twsocket Tcp client is still connected ?

    I am sorry, one more question if you please. What is different between OnError, OnSocksError, OnBgException events? What I need to use? Regards, Dmytro
  26. Angus Robertson

    how to Properly check if Twsocket Tcp client is still connected ?

    You can also check if a new client connection is from the same IP address as an existing client and use that to close the stale connection. TWSocketClient has a property CPeerAddr you can read. Angus
  27. Dmytro Lendel

    how to Properly check if Twsocket Tcp client is still connected ?

    O! Thank you! Will try. Regards, Dmytro
  28. Yes, but call Abort not Disconnect.
  1. Load more activity
×