Solved Copy Paste Text Too Long error

MsAccessNL

Member
Local time
Today, 16:47
Joined
Aug 27, 2022
Messages
216
I have a long text field when i paste a text in the table or in a form, i get message "Text too long to be edited" , If i copy smaller parts it will work. (25000characters wil work). I want to store a picture as Base64, this is a long text file. Pasting into NotePad works fine.
 
Base64 is a series of Byte array, meaning it is binary.
you need a VBA decoder to decode the base64.
 
Base64 can also be represented as a character string.
 
here is a demo, open form1.
see the code behind the buttons.
see the other modules.
 

Attachments

That's not the problem. The Problem is that i can't past a long text (the base64 character string)
 
Can you not use code to assign the value rather than copy paste?
 
At the end, yes, but know with testing, its a pain in the.., Is this a normal error in access, with pasting large text files?
 
Code:
' https://stackoverflow.com/questions/14219455/excel-vba-code-to-copy-a-specific-string-to-clipboard/60896244#60896244+
'Overcomes error text to long in Access thnx to Arnelgp

Function Clipboard$(Optional s$)
    Dim v: v = s  'Cast to variant for 64-bit VBA support
    With CreateObject("htmlfile")
        With .parentWindow.clipboardData
            Select Case True
                Case Len(s): .setData "text", v
                Case Else:   Clipboard = Nz(.getData("text"))
            End Select
        End With
    End With
End Function
 
here is an update, Base64 from Clipboard.
open Form1.
Do you know if it makes any difference in bloating if you store images as Ole object or as Base64 string? (i know storing path is the best, i am just curious).
 
it will always bloat when you store the "data" in a table.
 
Do you know if it makes any difference in bloating if you store images as Ole object or as Base64 string? (i know storing path is the best, i am just curious).
If the storage of an image as an Ole object stores just the raw binary data (I'm not sure) then storing a Base64 string instead would need more storage:

Base64 encoding causes an overhead of 33–37% relative to the size of the original binary data (33% by the encoding itself; up to 4% more by the inserted line breaks).
(see here)
 
If the storage of an image as an Ole object stores just the raw binary data (I'm not sure) then storing a Base64 string instead would need more storage:
True.
The original, quite massive, bloating problem with storing images was that Access was converting all images to Bitmap format and thus massively increasing the files size of compressed image formats, such as JPG or PNG.
This should no longer be a problem if you enabled the "Preserve source image format" setting in the Options for the current DB.

But in any case, storing a lot of data, be it text or binary, will increase the file size of the DB accordingly. Database systems in general do not take this well because it inflates the DB file and will flush their buffers if the data needs to be pipelined to a client.
 

Users who are viewing this thread

Back
Top Bottom