CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 How to show an image with path get from database?

Print topic Send  topic

Author Message
vove
Posted: 05/11/2003, 8:42 PM

I have a path on server "/store/largeimg", and filename store in database is "image1.jpg". I want to show this image. How can I do?
Jack
Posted: 05/12/2003, 1:46 AM

Hi,

make a grid with your table field with image path, then change the properties of that labelfield to image. That's it.

Goodluck,

Jack
Hamilton
Posted: 05/12/2003, 8:42 AM

Add a label field to the grid or form
Call the label field lblDBImage

Add the following code to the Before_Show event for lblDBImage
Modify RSName to be the name of the Forms RecordSet

Function New_Members_lblDBImage_BeforeShow()
On Error Resume Next
Dim SQL
Dim RecordSet

Dim lngID
Dim sImagePath
Dim sImageName
Dim sResult
lngID = New_Members.Datasource.recordset.fields("ID")
SQL = "SELECT imagepath, imagename from MYTable Where ID=" & lngID
Set RecordSet = New_Members.Execute(SQL)
If New_Members.Errors.Count = 0 Then
sImagePath = New_Members.DataSource.Recordset.Fields("imagepath")
sImageName = New_Members.DataSource.Recordset.Fields("imagename")
sResult = "<image src=""" & sImagePath & sImageName & """>"
End If

New_Members_lblDBImage.value = sResult
End Function

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.