[thelist] ASP image database reteval

Filip Salomonsson filip at netdesign.se
Wed Mar 7 10:27:32 CST 2001


Keni Barwick:
> I am having tuns of trouble with this code. I am trying to place
> an image into a page, the image is being serverd by a database.
>
> <%
> Response.Expires = 0
> Response.Buffer = TRUE
> Response.Clear
> Response.ContentType="image/gif"
> Set Connection = Server.CreateObject("ADODB.Connection")
> Connection.Open "DSN=WorkDB"
> SQLB = "SELECT fldVisuals FROM tblWorkVisuals WHERE fldCompanyName= "
> SQLB = SQLB & Request("workTitle")
> Set rsImage = Connection.Execute(SQLB)
> Response.BinaryWrite rsImage("fldVisuals")
> Response.End
> %>
>
> but its not having any of it!!

You need to be a bit more specific.
Does it return garbage? Does it return an error message?
What is the data type of the fldVisuals field in your database?


Also, when dealing with request data and SQL queries, you should _always_ at
least replace "'" with "''", or someone could potentially erase your entire
database. Or something else that's probably not very nice, either.

Read this: <http://www.4guysfromrolla.com/webtech/051899-1.shtml>.

/filip

--
filip(salomonsson)@netdesign.se -- ADP/IT consultant





More information about the thelist mailing list