

Squall_FF8
Members-
Content Count
83 -
Joined
-
Last visited
Community Reputation
1 NeutralTechnical Information
-
Delphi-Version
Delphi 12 Athens
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
MS SQL, How to make a TfdQuerry returns Date in a specific format?
Squall_FF8 replied to Squall_FF8's topic in Databases
@weirdo12 Great example and practical illustration!!! May we adapt it, if the text is in RichView (instead of Memo) and it is more complicated, like: xxxxx [Ticket."ticket_date"] xxxxxx -
MS SQL, How to make a TfdQuerry returns Date in a specific format?
Squall_FF8 replied to Squall_FF8's topic in Databases
Good old Convert ... I'm wondering is there more convenient way - to set format per session, like in Oracle (you set some local settings only for "your" session). The reason is that I have tables with 20+ fields (at least 6 are in date format) and that will make huge Select statements. -
MS SQL, How to make a TfdQuerry returns Date in a specific format?
Squall_FF8 posted a topic in Databases
Hey guys, I have old MS SQL 2008 and a Query (FireDAC), that returns some fields in Date format. In a Delphi application all work great, it seems FireDac takes care to visualize Date to FormatSettings. However when I open a FastReport document, it seems it convert Date to a the PC local settings (different from my changes in FormatSettings). And that is not good, because on different machines, results could look differently. I wonder, is there a way, to force Dates in FastReport to be in my desired format regardless of the PC local? A possible solution, could be if I force the Query to return the desired format, I just wonder how? -
Hmm are you suggesting, that because Main is the owner of the 2 windows (and the Edit), the Actions have higher precedence? (and thus difference in behavior)
-
Yes, to both questions, The 2 are created on demand and reused after that (if/when needed)
-
Hey guys, I found the following mystery. Could you help me to solve it? A VCL application with Main form. On that form we have Edit and panel that different forms attach to it (one at a time, depending on a context). - The Edit has OnKeePress that handle, when Enter is used. - Attached forms have Action that has short-key: Enter. - 7 of Attached forms are Auto created (in the project). - 2 of Attached forms are created only once per use in run time. The mystery: What will happen if the Edit has a focus and I hit Enter? Whose handler will be triggered - Edit or attached window? Well at run time, if I have attached one of the 7 - Edit handler respond. If I have attached one of the 2 - their handler respond. So I guess my question is WHY? Why the difference between 7 and 2 windows? What is going on under the hood?
-
Thank you very much!!! Usually thigs like this have default name that is good enough (it works, the name = you dont use/dont care) Are you talking for Aggregates in general, or my example of use?
-
Hey guys, I wanted to do simple thing - use Aggregates. So following the help: procedure TForm.Button1Click(Sender: TObject); begin if Qry.Aggregates.Count = 0 then with Qry.Aggregates.Add do begin Expression := 'COUNT(Town)'; Active := True; Qry.AggregatesActive := true; end; end; Should be pretty simple, right? But I get error (on Activate := true): Do you know why? What I'm doing wrong?
-
Hey guys, I have a shared folder on the local net that I want to be able to Copy/Move/Delete files from it with a Delphi application. It works great when I share that folder with unlimited access. For security requirements I cant do that - I need to make it accessible only with user/pass Do you know how I can that?
-
If I remember correctly, the whole concept/interface with Post, Edit, EoF, First, Next,... was created for BDE, but was so loved/easy to use by developers that its functionality was replicated in general and every new DBset specific for specific DB (DAC, FireDAC, I even had components for Postgre and Oracle implementing those). It doesn matter for the thread, but for general DB perspective, MSSQL as a spiritual successor of Access, comes natively packed with auto-inc. So you dont need triggers for that. Later versions added Sequence (I guess influenced by Oracle ). Even IBX adopted Sequence, which if used makes Generators a little obsolete.
-
THANK you very much for that explanation!!! It clears my confusion. I assume that is the BDE way, but I missed that class (academic, not Delphi) 🙂 BTW what happens with the ID after Insert? Is it automatically received or you need to make sure that Insert statement have the right things (like 'OUTPUT INSERTED ID' in MS SQL)
-
How I can do that for create (Insert)? My Query returns only 1 record, from Where clause (usually ID of a table). But if it is a new record ...? BTW Using Select to Insert/Update - that will never come to my mind 🙂 I understand that actual operations come from Edit/Append. Thank you!
-
It will be interesting to peek in a snippet of it ^_^ How that works in conjunction with TQuery? I mean, when I call ExecSQL with Insert/Update, TDBRichEdit automatically provides the context for my BLOB field (no extra code)? Or I need to provide some code before/after ExecSQL?
-
TBH, I dont know how to escape for MS SQL query. However as you said control codes are not needed for RTF standard, so I just made a routine that skips them. And all works fine now!!! BTW this might be interesting for you - Delphi and WordPad put exact same control codes. In my observation - 13, 10 after \par and 0 at the end. Good point - great suggestion! Thank you very much for taking time to write detail answers!!!
-
Thank you @Tom Chamberlain for the code and comments!!! I'm sure it will be very helpful. Later today I will examine it very carefully.