p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

asp_databases thread: Images


Message #1 by "Matt Besseling" <mattb@h...> on Mon, 24 Jul 2000 9:8:29
I got a complete source code for a shopping cart facility from 

superexpert.com. Everything works fine, except I can's display images from 

the database. It keeps giving me a Microsoft VBScript runtime error 

'800a000d', Type Mismatch. I looked on ASPToday.com, and there is quite a 

long function to retrieve images from a database, but all I have is in my 

procs.inc file this:



'First cell for picture

  sTemp = trim("" & rsProducts("Picture"))

  if sTemp = "" then

    sTemp = "Picture Not Available"

  else

    sTemp = "<img src='images\stamps\" & sTemp & "' border=0 alt=''>"

  end if

  response.write "    <td align='center'>"

  response.write "<font face='Verdana, Arial' color='#008000' size='-1'>"

  response.write sTemp & "</font></td>" & vbcrlf



Which is the correct script? Does the error have something to do with the 

image TYPE? I am saving them as OLE objects in an access database, as gif 

files.



Any help would be really appreciated.



Regards

Matt Besseling

Message #2 by "Ken Schaefer" <ken.s@a...> on Mon, 24 Jul 2000 21:08:45 +1000
The code that you have shown below does not extract images from a database.

Instead it appears that the file names are stored in the database and are

dynamically written to the src attribute of the <img> tag.



Since what you are actually storing is binary data rather than the text that

your code is expecting. My guess is this is why you are getting the type

mismatch errors.



Cheers

Ken

----- Original Message -----

From: "Matt Besseling" 

To: "ASP Databases" <asp_databases@p...>

Sent: Monday, July 24, 2000 12:00 AM

Subject: [asp_databases] Images





> I got a complete source code for a shopping cart facility from

> superexpert.com. Everything works fine, except I can's display images from

> the database. It keeps giving me a Microsoft VBScript runtime error

> '800a000d', Type Mismatch. I looked on ASPToday.com, and there is quite a

> long function to retrieve images from a database, but all I have is in my

> procs.inc file this:

>

> 'First cell for picture

>   sTemp = trim("" & rsProducts("Picture"))

>   if sTemp = "" then

>     sTemp = "Picture Not Available"

>   else

>     sTemp = "<img src='images\stamps\" & sTemp & "' border=0 alt=''>"

>   end if

>   response.write "    <td align='center'>"

>   response.write "<font face='Verdana, Arial' color='#008000' size='-1'>"

>   response.write sTemp & "</font></td>" & vbcrlf

>

> Which is the correct script? Does the error have something to do with the

> image TYPE? I am saving them as OLE objects in an access database, as gif

> files.

>

> Any help would be really appreciated.

>

> Regards

> Matt Besseling

>

> ---

> Do you know what you want from this list? How would you provide

programmers with the solutions they need? If you have the answers, and are

willing to work in Birmingham (UK), then you could be a List Manager. Please

send CVs and a covering letter to listsupport@p... for further

information.

> ---

> You are currently subscribed to asp_databases


$subst('Email.Unsub')

>

>




  Return to Index