Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display stored images in a data access page?

Status
Not open for further replies.

marle35

Programmer
Jul 17, 2007
36
Is there a way to store images in the database, but also have them show up in data access pages in addition to forms? I know I can store links to images, but they exist outside the database. I have tried the OLE object datatype, but Access won't let me put that in a data access page. Is there a way to do this, keeping the images in the database?
 
I am trying to display images stored -in- the database, not from any type of URL.
 
All the same. Step by step.
In my table, I have a field called Photo. So the data in this column looks like this: c:\parcel_79.png
On the DAP, I have an Image control. It is called Image0
I have a combobox so the user can select a record. In my example it is called ParcID. On the "onchange" event, I have:

<SCRIPT language=vbscript event=onchange for=ParcID>
Dim rs
Set rs = MSODSC.DefaultRecordset
rs.Find "[ParcelID] = '" & document.all.item("ParcID").value & "'", 0, 1, 1
Image0.src = photo.value
-->
</SCRIPT>

So when someone selects a record, the code creates a recordset of the source of the DAP, searches through that recordset, and when it finds the appropriate record it displays the photo in the image control.

The Find statement is all on one line.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top