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})