<% 'prodinfo.asp Option Explicit Dim showsearch, showcart, showcheckout, showany showsearch=TRUE showcart=TRUE showcheckout=TRUE showany=TRUE Dim i Dim thisProductCode, thisDescription, thisPrice, thissubtitle, _ thisName, errortext, category1, category2, thisoriginalprice, thispages, _ thiscondition, state, thisexpiration, thissold, firstimagenumber Dim Conn, MySQL, cmd, RecSet thisProductCode=Request.QueryString("p") If Len(thisProductCode)>0 Then Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open Application("dsn") mySQL = "sp_findproduct '" & thisProductCode & "'" Set Cmd = Server.CreateObject("ADODB.Command") Cmd.ActiveConnection = Conn Cmd.CommandText = mySQL Set RecSet = Server.CreateObject("ADODB.RecordSet") RecSet.Open Cmd, ,0,1 If RecSet.EOF Then errortext = "Product not found." Else thisName = RecSet.Fields("title") thissubtitle = RecSet.Fields("subtitle") thisDescription = Replace(RecSet.Fields("Description"),vbcrlf,"
") thisPrice = RecSet.Fields("Price") thisexpiration = RecSet.Fields("expiration") thissold = RecSet.Fields("sold") If isNull(thissold) Then thissold=0 End If End If Set RecSet = Nothing Conn.Close Set Conn = Nothing 'Get first image number if there is one. Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open Application("dsn") mySQL = "sp_getfirstimagenumber '" & thisProductCode & "'" Set Cmd = Server.CreateObject("ADODB.Command") Cmd.ActiveConnection = Conn Cmd.CommandText = mySQL Set RecSet = Server.CreateObject("ADODB.RecordSet") RecSet.Open Cmd, ,0,1 If Not RecSet.EOF Then firstimagenumber=RecSet.Fields("imagenumber") End If If IsNull(firstimagenumber) OR firstimagenumber<1 Then firstimagenumber=1 End If RecSet.Close Set RecSet = Nothing Conn.Close Set Conn = Nothing Else errortext = "Book not found." End If %> setsuko.com - Item Information <% If Len(errortext)=0 Then %>

<%=thisName%>
<%=thissubtitle%>

   
Price $<%=FormatNumber(thisPrice,2)%>       <% If thisexpiration<=(DATE+180) and Not thissold Then Response.Write " Listing expires: " & FormatDateTime(thisexpiration,2) & "" End If %>


<% If NOT thissold Then %>

<% Else %> THIS ITEM IS SOLD... Sorry <% End If %>
Description: <%=thisDescription%>

<% Else %>

<%=errortext%>

<% End If %>