digitalwav
asked on
How To Save PDF to Blob field in MS Access
I've spent a while looking on EE for an answer but everything is about storing images in access (can't load a pdf info an image box...). I need to store a PDF file (or any file for that matter) into a OLE Object field in an Access DB. The files this time happen to be PDF.
Code examples would be appreciated!
Code examples would be appreciated!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
well, the load it to the db seems to work, but getting it back out results in a zero size file.
Hmmm... Don't know. Werks fer me!
The only problem I could envision would be your field type is something other than a OLE Object for an Access database table or in the case of MS SQL something other than an image field type, or the field is empty. Your cursor might on the wrong record.
Hope you get it!
John
The only problem I could envision would be your field type is something other than a OLE Object for an Access database table or in the case of MS SQL something other than an image field type, or the field is empty. Your cursor might on the wrong record.
Hope you get it!
John
ASKER
yuppers, it was grabbing the wrong record, works perfectly! Thanks! Quick and simple.
procedure TForm1.Button1Click(Sender
var prm: TParameter;
begin
prm := ADOQuery1.Parameters.AddPa
prm.Name := 'pic_data';
prm.LoadFromFile('file_nam
ADOQuery1.SQL.Add('insert table_name(blobfield) values (:pic_data)');
end;
ziolko.