<% If Request.QueryString("id") <> "" Then Dim objConn, objRS, strSQL Set objConn = Server.CreateObject("ADODB.Connection") objConn.Open Session( "DSN_ConnStr" ) strSQL = "SELECT tblVehicles.* " & _ "FROM tblVehicles " & _ "WHERE (((tblVehicles.VehicleID)=" & Request.QueryString("id") & "));" strSQL = "SELECT tblVehicles.*, tblVehiclePhotos.ImageName, tblVehiclePhotos.PrimaryPhoto " & _ "FROM tblVehicles INNER JOIN tblVehiclePhotos ON tblVehicles.VehicleID = tblVehiclePhotos.VehicleID " & _ "WHERE (((tblVehicles.VehicleID)=" & Request.QueryString("id") & ") AND ((tblVehiclePhotos.PrimaryPhoto)=-1));" 'Response.Write(strSQL) Set objRS = objConn.Execute(strSQL) If Not objRS.EOF Then %>
<%= DatePart("yyyy", objRS("VehicleYear")) & " " %><%= objRS("VehicleMake") & " " %><%= objRS("VehicleModel") %>
" width="500">
Description:
<%= objRS("VehicleDescription") %>
<% If (FormatCurrency(objRS("VehiclePrice"))) <> "$0.00" Then Response.Write("Price" & FormatCurrency(objRS("VehiclePrice")) & "") %>
View Photos:
<% If Request.QueryString("id") <> "" Then Call DisplayVehicleThumbNails(Request.QueryString("id")) End If %>
<% Else Response.Write("Sorry, not able to locate vehicle information.") End If Else Response.Write("Sorry, not able to locate vehicle information.") End If 'Clean Up objRS.Close() Set objRS = Nothing objConn.Close() Set objConn = Nothing %>                                                                                                                                                                                                                                                                                                                                                                         
<% Sub DisplayVehicleThumbNails(ByVal strVehicleID) Dim objConn, objRS, strSQL Set objConn = Server.CreateObject("ADODB.Connection") objConn.Open Session( "DSN_ConnStr" ) strSQL = "SELECT tblVehiclePhotos.* " & _ "FROM tblVehiclePhotos " & _ "WHERE (((tblVehiclePhotos.VehicleID)=" & strVehicleID & "));" Set objRS = objConn.Execute(strSQL) If Not objRS.EOF Then Dim iCounter iCounter = 0 %> <% Do While Not objRS.EOF If (iCounter mod 3) = 0 Then %> <% End If %> <% If (iCounter mod 3) = 2 Then %> <% End If iCounter = iCounter + 1 objRS.MoveNext Loop %>
" onclick="WindowOpen('preview_thumb.asp?id=<%= objRS("PhotoID") %>');" onmouseover="MakePointer(this);" width="150" border="0" />
<% Else Response.Write("
Sorry, no additional photos for this vehicle.
") End If 'Clean Up objRS.Close() Set objRS = Nothing objConn.Close() Set objConn = Nothing End Sub %>