Home > ASP Development > Issue with inch unit "

Issue with inch unit "



Hi,





I'm making a music store and the music will be sold in various formats, mp3, tape, cd and 12 inch (12")



The problem is in a form on my homepage where the user can select to browse by format type...




Code:



<h3>
Browse by Format
</h3>



<form action="browse.asp" method="get" name="formatname">

<select name="formatnames">

<%
Do While Not (objRs.EOF)
%>
<option value="<%=objRs("FORMAT_NAME")%>"><%=objRs("FORMAT_NAME")%></option>
<%
objRs.MoveNext
Loop
objRs.Close
Set objRs=Nothing
objConn.close
Set objConn=Nothing
%>


<input type="submit" value="Search" />






That is passed to the browse.asp page




Code:



Dim strformatpass, strSQL, objConn, objRs

strformatpass = Request.QueryString ("formatnames")


strSQL = "select * from ec_view_tunes where format_name = '" & strformatpass & "'"






But the whole thing is getting confused with all the quotation marks and it only works with cassete, tape, MP3 and CD. It returns no results for 12" and 7" although there is data for these 2 formats in the db.



Any ideas how to get by this??



Thanks.

    
Guest


Use this as your sql statement:


Code:


"select * from ec_view_tunes where format_name = '" & Replace(strformatpass, "'", "''") & "'"



Was this answer helpful ? Yes No   
Guest


Thanks, works well

Was this answer helpful ? Yes No   
Guest
 
 
Home - About Infoqu - Contact - Privacy Statement - Link to Infoqu - Bookmark Infoqu

Copyright 2007-2008 by Infoqu. All rights reserved