Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 14th, 2006, 02:40 PM
Authorized User
Join Date: Mar 2005
Location: arima, West Indies, Trinidad and Tobago.
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to arimakidd
Default viewing images in asp from access

I am trying to display images that would have been uploaded to an access database using an access form. The data entry is done in access. asp is being used to peruse the database. Based on my research I should pull the images out on one page and then refer to this page using html embed syntax. However I am not sure how good this works cause the first page is not even displaying the image. Thus far this is the code for the page that is supposed to pull out the image:

Dim adoCon         'Holds the Database Connection Object
Dim serVisit   'Holds the recordset for the records in the database
Dim strSQL          'Holds the SQL query to query the database

countn = 0

Response.Expires = 0
Response.Buffer = TRUE

'Create an ADO connection object
Set adoCon = Server.CreateObject("ADODB.Connection")

'Set an active connection to the Connection object using a DSN-less connection
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("FirmDataEntries.mdb")

Set rs = adoCon.Execute("SELECT Photograph FROM Offtbl WHERE OfficerName='JAMES BROWN'")

Response.ContentType = "image/gif"
Response.BinaryWrite rs("Photograph")

Set rs = Nothing
Set adoCon = Nothing
Now the funny thing is that when I load the page in the "status" bar it reads donwloading from page etc..... The name of the page. But when its finished all you see is the broken icon which represents that an images is supposed to be displayed but some error has happened so nothing displayed. Something like what you get when you have an incorrect path to the image in your html. Would appreciate some help on this. Also future recommendations on a more stable platform for viewing pictures from a db.

Reply With Quote
  #2 (permalink)  
Old August 15th, 2006, 03:26 AM
Authorized User
Join Date: Mar 2006
Location: Chennai, Tamil Nadu, India.
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Raghunathan


Possible reason for your problem would be .. since you are using MS-ACCESS Db, in Access Images are stored as OLE Objects, it would'nt be possible to retrieved.

maybe u can try changing the content type to the appropriate content type of the image stored in the DB and
you've to use like this

   Response.Binarywrite rs("Photograph").GetChunk()

hope this info would help u

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem Viewing Large Images arimakidd BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 November 20th, 2006 03:27 PM
viewing MS Access report from VB 6.0 jthadathilm16 Pro VB Databases 1 May 4th, 2006 08:15 PM
Viewing Data Access Pages thru internet pans HTML Code Clinic 1 February 2nd, 2005 09:57 PM
retrieving images from Access DB into asp page programmer_scs Classic ASP Databases 1 November 30th, 2004 10:19 AM
Viewing Access snapshots dnaworks Classic ASP Databases 3 October 6th, 2004 09:50 PM

All times are GMT -4. The time now is 09:32 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.