1

I'm trying to return an image which is stored as an attachment in an access database from another program - it's a Word add-in (so using .net) which uses the ODBC connector for querying the access database. When I query like this:

SELECT [Document Uploads].[Uploaded Docs] FROM [Document Uploads] WHERE([Document Uploads].Model_Docs = ${machine})

It returns the filename of the attachment, as expected (the ${machine} value is something that gets passed in at runtime from the program this is getting run from - I've already confirmed that that part is working correctly).

When I add the .FileData field to my query so it looks like this:

SELECT [Document Uploads].[Uploaded Docs].FileData FROM [Document Uploads] WHERE([Document Uploads].Model_Docs = ${machine})

It returns me a System.Byte[], but an extremely short one that definitely is not the image that's stored there.

Is there something missing in my select that's not getting me to the right field?

Edit/Update - I changed it to Attachments.FileData and it's returning the same thing:

SELECT [Document Uploads].[Uploaded Docs].Attachments.FileData FROM [Document Uploads] WHERE([Document Uploads].Model_Docs = ${machine})
That One Guy
  • 551
  • 1
  • 4
  • 8
  • You might get more specific assistance if you edit your question to specify what type of "other program" is retrieving the data (.NET? Java?) and what sort of connection is being used (ODBC? OleDb?). – Gord Thompson Feb 06 '14 at 22:16
  • I've edited the original post - it's a Word add-in (so .Net based) using the ODBC connector. – That One Guy Feb 06 '14 at 22:19

0 Answers0