0

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 attachement can be like 0.5 MB to 3 MB.

It says

Overflow

on this line

Redim attachmentBytes(32767) 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.

  • Correction: Sorry for one mistake. Up to 32767 it is ok but after that (like 32768) it says overflow. – user1575786 May 02 '23 at 06:37
  • 1
    Handling attachments is a PITA. Most of us save it to disk then upload. It's either that of use the NotesStream class. Java is definitely the way to go imho. This article by Andre Guirard might also help. https://lotusscript.torknado.com/blog/read-attachment-files-without-writing-to-disk/ – Adam May 02 '23 at 13:07

1 Answers1

0

Java can be used instead of LotusScript in some contexts within Notes, and Java will not have that limit. So the first thing I would consider is whether your LotusScript code can be rewritten (fully, or just in part) as a Java agent.

Richard Schwartz
  • 14,463
  • 2
  • 23
  • 41