Re: adob.stream - open local file ?

JJ <[email protected]> Wed, 28 May 2025 21:45:21 +0700
Newsgroups alt.comp.lang.vbscript,alt.windows7.general
Organization A noiseless patient Spider
Message-ID <[email protected]>
On Wed, 28 May 2025 12:07:54 +0200, R.Wieser wrote:
> Hello all,
> 
> I'm using VBScript, an adob.stream object and its "open" method to try to 
> access a big*, local file.
> 
> * ~ 4GB, which is why I don't want to use loadFromFile.
> 
> Alas, no matter if I provide a relative or absolute path to the file, I get 
> the same error message every time :
> 
> "ADODB.Stream: Arguments are of the wrong type, are out of acceptable range, 
> or are in conflict with one another."
> 
> I've googled for some example code, but somehow can't find any.
> 
> Does anyone know what might be the problem ?
> 
> Regards,
> Rudy Wieser

The limit is platform and environment dependent.

On actual tests in Win7 x64 with 16GB RAM (3.4GB used; msado15.dll
v6.1.7601.17857), using binary file mode...

Both 64-bit and 32-bit versions have different limits, but the limit is
inconsistent. Meaning that, it's system and environment dependent. i.e. what
additional DLLs are loaded, and probably also free memory space
fragmentation.

32-bit one can load around 1,887,800,000 to 1,887,820,000 bytes file. Not
even (2^31)-1 bytes. The size difference is probably within 64KB. It was
virtually impossible to find the exact limit.

64-bit one can load more than 4GB. At least from 9,900,000,000 bytes file
when tested. Larger file isn't tested. The limit is likely inconsistent like
above.

Also keep in mind that, array index in VB/VBA/VBS uses platform dependent
signed integer. That's the hard limit.