This week's book giveaway is in the Reactive Progamming forum. We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line! See this thread for details.
I actually wasn't very smart when I wrote this. My image URL is a fully qualified URL with the domain name, path and file. The most flexable approach would be to split those fields out. That way if code ever moves to a new domain it's easy to update. That's a minor problem though. Visual Basic would handle this just a little differently. After creating an image/picture object on the form you code set it's source to the location and filename of your image. I think Visual Basic requires path names as opposed to URL's for it's image locations. My VB days are far in the past. If someone has a few lines of sample code I'd be happy to post it here. SELECTing Images Now we'll retrieve images from SQL Server using ASP. In case you've forgotten (or I didn't mention it enough above) this is really a pain. You are going to need two separate ASP Pages. This code will pulled from a Microsoft Knowledge Base article. The first I called Picture.asp and it looks like this: <HTML> <HEAD><TITLE>Display Image</TITLE></HEAD> <BODY> This page will display the image New Moon Books from a SQL Server 6.5 image field.
</BODY> </HTML> This calls the ASP page PicShowImage.asp which looks like this: <%@ LANGUAGE="VBSCRIPT" %> <%<br /> ' Clear out the existing HTTP header information<br /> Response.Expires = 0<br /> Response.Buffer = TRUE<br /> Response.Clear<br /> ' Change the HTTP header to reflect that an image is being passed.<br /> Response.ContentType = "image/gif"<br /> Set cn = Server.CreateObject("ADODB.Connection")<br /> ' The following open line assumes you have set up a System DataSource<br /> ' by the name of myDSN.<br /> cn.Open "Provider=SQLOLEDB; Data Source=server9; Initial Catalog=pubs; User ID=sa; Password="<br /> Set rs = cn.Execute("SELECT logo FROM pub_info WHERE pub_id='0736'")<br /> Response.BinaryWrite rs("logo")<br /> Response.End<br /> %>
We don't have time to be charming! Quick, read this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop