saving BLOBs/files in sql backend via pass through in vba

Wolow

Registered User.
Local time
Today, 18:22
Joined
Dec 27, 2009
Messages
10
Hi,

I would like to store a field/image etc in a back end sql server via pass-through. The problem: as I understand pass through, I have to format everything into string or at least parts of strings. How can I just concentrate on bytes and have that sent over to the sql server? I understand there is no way to just use a variable name like I would do in php.

any help highly appreciated
 
This could work, but I wouldn't consider doing as much personally.
You're requiring that every byte of binary data can be represented with an Ascii character which you push into a Passthough's definition. (As you point out, it's a string).

For convenience, I've been known to dump ImageData into a Memo field (instead of a long binary field - or OLE Object as you'll know them as in Access UI).
It works. The field can handle the binary data as Ascii characters. But it's... "make do".

Apart from anything else, you'll be very possibly stuffing an enourmous character length into the passthrough's definition. Are you sure you'll never pass the limit?

IMO, it's just not worth it.
I'd not consider the passthrough for that task.
You'd have to use code to manipulate the defintion of a passthrough prior to executing it anyway - so you might as well tailor that code and execute the BLOB insertion by another means.
I don't think I've provided a DAO example, but there's an ADO one in the examples page linked to in my sig below.

Cheers.
 
THanks a lot,

thats what my gutt feeling told me, too, but its a relief to hear that from an expert.

Cheers
 

Users who are viewing this thread

Back
Top Bottom