

Squall_FF8
Members-
Content Count
73 -
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.
-
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.
-
Yes, I had similar problem. If you scroll down, you should find my post - I updated everything for future reference (as the case is now) In short the problem is from 32/64 mode. Windows come with mdb support only for 32. In 64 you can use mdb/accdb (because we usually install 64 versions of Access). And because Delphi is still 32 ... no design mode (unless you do something hacky (like '/passive /quiet') to have 32 drivers too. But I have to admit, that Delphi couldnt get all the blame. If you work with well supported DB (for example MS SQL) you get both 32/64 drivers.
- 14 replies
-
OK, I did: // To get RTF var Stream := tStringStream.Create; Rich.Lines.SaveToStream(Stream); Result := QuotedStr(Stream.DataString); // for Insert/Update, the text needs quotes However when I use the result in Query, I get error - it messes up the syntax of the SQL. So I inspected the returned DataString ... It seems it uses not just plain text, but control codes: 13, 10, 0. That creates 2 problems: 1. QuotedStr - formats it in Delphi way: 'text'#13#10'text'.... SQL doesn't like that! 2. #0 is considered end of a string (most of the times) and Delphi cuts what follows. Questions: - Since when RTF includes control codes (ASCII < 32)? If that is the case then things like `\par` are nonsense. - The RTF text states version 2.0. Do you know what version of RichEdit Delphi 12+ uses? Because of: "{\rtf1\ansi". I'm not familiar with "RTF using 8bit characters". Does Delpji / Windows RichEdit supports that? Do you know of a program that supports that?
-
Hi guys, I have a TFDQuerry connected to MSSQL that returns a record with field Test - nvarchar(max). I would like to be able to Paste a text from Word in a RichEdit and be able to save it (formatted as RTF) in Test and latter on load it from there. How I can do that? (code snippet) P.S. If possible I try to use Insert/Update statements, but if I have to - I will use BLOBs. I just dont understand how blobs work in conjunction with normal Insert/Update.
-
Not even a suggestion! Does that mean, that nobody is using FastReport?
-
Hey guys, I'm trying to make a document in FastReport that will look like: * Contract Text - RichText with some data fields. text could be huge (more then a page!!!) * Small Table - TableObject with 2 columns for Contract Objects (max 4 lines) * Contract Text - same as above. I did that in FastReport like: * ReportTitle (logo + ...) * MasterData (band) - RichText - TableObject with event for Manual Build and code copied from Demo (how to make TableObject display DB) - RichText * PageFooter (for Page Numbers) And it didnt work: - The TableObject is not shown!. I suspect Manual build is not called. If I put it directly on Page1 it works. It works with other bands too, just MasterData - no. You would think - just remove MasterData, but: - Since RichText is huge, I can make it print on several pages only inside MasterData. Is there any other ways? Could you guys advise me? How you would implement such document? If it matters, my version is 2023.2.
-
That is a common misconception among developers and clients. The reason is - contemporary computers are way to fast to objectively judge what is slow and what is fast. Usually developers have fast computers with fast disks/memories. But what happens when you deploy to clients? (files are on the VPN network in my case). I would suggest to put a counter in your CalcField - to simply counts how many times your disk code was used. Then use your app as normal, especially scrolling records/view of the table. And check the counter, right before you destroy the form. You might get a surprise. But whatever number you get, its always a comparison of 1 to many (1 for cashed).
-
Whoah that is exactly my case! Thanks to the help of the guys here, I also came to: "ODBC driver does not recognize these types and maps them to WideStrings" Unfortunately I dont know how to map, (or is it even possible to change it). As an easy fix, I just manipulate the string on GetText, it turned out the first 5 chars is what I need.
-
I dont understand your question .... If you read carefully my initial post, you will see that I use both. As @Uwe Raabe explained well, the Dictionary simply play the role of a cache, specifically - a disk-cache. In Fact the actual FileSize reading is done just once per file/record (on-demand).
-
if not Dic.TryGetValue(QryID.AsInteger, n) then begin var info: TWin32FileAttributeData; GetFileAttributesEx(PChar(QryFileНаме.AsString)), GetFileExInfoStandard, @info); Dic.Add(QryID.AsInteger, info.nFileSizeLow); end; GetFileSize is probably faster, but require more code. Also the result is limited to 4GB. If you need larger sizes you need to account for nFileSizeHigh too.
-
Thank you! So kind of FetchOnDemand approach, I like that. It will be even less code P.S. Does anybody knows why we have such weird execution order: Calc, AfterOpen, Calc? Is there anyway to control this? Or at least to "force" Grid to display the fetched values in the second Calc?