ADP: How to use button control to view a binary image?

  • Thread starter Thread starter Altemir
  • Start date Start date
A

Altemir

I have an ADP/SQL Server table that has a column called "Document" with
data type = image.

Does anyone have an example of some VBA code that I can use in the
OnClick event of a form button that will retrieve the long binary image
and open it up for viewing with the proper Windows application? (my
application primarily stores text files that can be opened in Notepad).

Thanks.
 
Altemir said:
I have an ADP/SQL Server table that has a column called "Document" with
data type = image.

Does anyone have an example of some VBA code that I can use in the
OnClick event of a form button that will retrieve the long binary image
and open it up for viewing with the proper Windows application? (my
application primarily stores text files that can be opened in Notepad).

Have look at this KB-Article:
http://support.microsoft.com/?kbid=194975
It demonstrates how to read/write files from an Image-Field in the
database.

For opening that file with the proper application, you may use the
"ShellExecute" API-Function. I don't have any sample available for
this, but you should easily find one when searching for that keyword
in Google.


In most cases it may be sufficient to simply use:

Application.FollowHyperlink yourFileName

to open the file.

Cheers
Phil
 
Back
Top