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


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.
 
Ad

Advertisements

P

Philipp Stiefel

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top