Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9015761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:49:51+00:00 2026-06-16T03:49:51+00:00

I am using Embarcadero Delphi XE2 I’m creating a fastreport (its not that important)

  • 0

I am using Embarcadero Delphi XE2

I’m creating a fastreport (its not that important) and saving it to TStringStream

Next just for tests I output that TStringStream to file, and the PDF saves fine and opens fine. It weights about 40KB (less)

What I need to do next, is write this PDF (TStringStream) to SQL database through INSERT, the only thing I do to modify it is I replace all ” with “” because its within ” quotes, otherwise the SQL doesn’t work.

The strange thing is, when I load the file from database, or even to SELECT length(attachment) where the attachment is PDF data saved earlier. When I do that, the size is more than 50KB (for some PDF’s even about 70KB), and the PDF is whole blank.

I am forced to use a simple mysql unit for this project which doesn’t allow some setParams or saving it through Blob object which I googled. So I need an answer concerning this simple method. Insert TStringStream to SQL database.

The database field is type MEDIUMBLOB

Thanks in advance!

Jack

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T03:49:52+00:00Added an answer on June 16, 2026 at 3:49 am

    The problem was solved by:

    1. Export through frxPDFExport,

    2. override its stream to TMemoryStream,

    3. Converting the TMemoryStream to Hex String

    4. and INSERTING it to sql as ‘0x’+converted_hex_string

    Thanks for help anyway,
    hope this answer helps with similar problem

    Important:
    it had to be TMemoryStream because of some strange ASCII chars in PDF, so when I exported it to TStringStream and then converted to hex, it came out corrupted.

    You can look up on the net there’s the function to convert byte array (TMemoryStream) to hexed string.

    Jack.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Embarcadero Delphi XE2 and I've got a project that I want
I'm working with Embarcadero Delphi XE2 and Firebird DB, using TIBDatabase , TIBTransaction and
I'm making an application in Embarcadero Delphi XE2. I'm using a PrinterSetupDialog to select
My application is written using : Embarcadero Delphi 2010 I have a form named
Does anyone have base32 implementation in Delphi? I found: http://cc.embarcadero.com/item/21566 but it is not
I am using Embarcadero RAD Studio XE2 Update 4 and the Indy package shipped
Yesterday I installed Delphi XE2 using the download option, so I guess the installed
Embarcadero help indicates that the XML Data Binding Wizard is also in XE2 (as
I'm installing a BPL (without dll) Delphi Expert using this Windows registry key HKEY_CURRENT_USER\Software\Embarcadero\BDS\x.0\Known
OK, I'm using Embarcadero Delphi 2010. Currently I'm using an Access database file named

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.