Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have to store attachments and pictures from HCL Notes to MS Sql database. I encounter two issues. First the Notes array limit is 32767 whereas the attachment can be like 0.5 MB to 3 MB.

It says

Overflow

on this line

Redim attachmentBytes(32768) As Byte

when I try to save the code in the designer.

So I think I have to build like an array of arrays to completely store the object. But here comes the second issue: how will I move this array to the varbinary field (attachment) of my table in MS Sql db?

I'll highly appreciate if somebody points to any other thread with such code coz I think this may be pretty common scenario faced by many developers.

I didn't place the code to extract attachments and move into array element for now coz I think that is not much relevant at this time, but I'll place it if asked to do so.

Thanks.

What I have tried:

I have tried stream and byte array but in vain. In fact, I'm looking for a function of GetEmbeddedObject which can provide the attachment object in like a binary stream or byte array or anything.
Posted
Updated 6-May-23 21:15pm
Comments
CHill60 4-May-23 5:09am    
I never store binaries in the database - I use a file system to store them and just store that (relative) location in the database table. It's a common technique.
mtoha 8-May-23 6:44am    
I am agree with above comment. never store file in the database. I store my file to hdd/ssd disk space or file store firebase or something like that. You can also using FTP if needed.

1 solution

hi, probably need one of the blob datatypes for the image. you mention 'attachments' but don't give details ... if its text then use the TEXT datatype.

check out :
https://dev.mysql.com/doc/refman/8.0/en/data-types.html
 
Share this answer
 
Comments
baburman 31-May-23 0:46am    
By attachment i mean images and pdf documents.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900