Home > SQL Development > search.asp

search.asp



<i><b>Originally posted by : lakshmi (sanchez@sheriff.ccso.org)</b></i><br /><br />I managed to get my search.asp to display data, however, i do not know how it is basing its display on.<br />Can someone look at my code, and tell me how I can get it so that a user can enter either of all those fields whether partially or not or just one of those fields and then be able to get a list of the names. I cannot figure out how to get it to do it. I am getting data now which is better than getting a blank page, but I am not getting the correct data.<br /><br /><%@ Language=VBScript %><br /><HTML><br /><HEAD><br /><TITLE>Query Results</TITLE><br /></HEAD><br /><BODY><br /><TABLE BORDER=1><br /><%<br /><br />Set Conn = Server.CreateObject("ADODB.Connection")<br />Set Buss = Server.CreateObject("ADODB.Recordset")<br />Conn.Open "DSN=BusinessBarcode;UID=sa;pwd=;"<br /><br />sSQL = "SELECT * "<br />sSQL = sSQL & " FROM [Business Master]"<br />sSQL = sSQL & " WHERE Business LIKE Business"<br />sSQL = sSQL & " AND Address LIKE Address"<br />sSQL = sSQL & " AND Barcode LIKE Barcode"<br /><br />Buss.Open sSQL,Conn<br />Do While Not Buss.EOF<br />Response.Write "<tr><td>" & Buss("Business") & "</td><td>" & Buss("Address") & "</td><td>" & Buss("Barcode") & "</td></tr>"<br />Response.Write vbcrlf<br />Buss.MoveNext<br />Loop<br />Buss.Close<br />Conn.Close<br /><br />%><br /></TABLE><br /></BODY><br /></HTML><br /><br />Any suggestions or perhaps you can point me to where there is a sample of something similar?<br /><br />Thank you <br /><br /><br />

    
Guest


<i><b>Originally posted by : srinivas (telut@yahoo.com)</b></i><br />Try "AND" in sSQL replaced with "OR".You might get probably what U want.There nothing wrong with asp code.<br /><br /><br />------------<br />lakshmi at 7/20/2000 4:14:34 PM<br /><br /><br />I managed to get my search.asp to display data, however, i do not know how it is basing its display on.<br />Can someone look at my code, and tell me how I can get it so that a user can enter either of all those fields whether partially or not or just one of those fields and then be able to get a list of the names. I cannot figure out how to get it to do it. I am getting data now which is better than getting a blank page, but I am not getting the correct data.<br /><br /><%@ Language=VBScript %><br /><HTML><br /><HEAD><br /><TITLE>Query Results</TITLE><br /></HEAD><br /><BODY><br /><TABLE BORDER=1><br /><%<br /><br />Set Conn = Server.CreateObject("ADODB.Connection")<br />Set Buss = Server.CreateObject("ADODB.Recordset")<br />Conn.Open "DSN=BusinessBarcode;UID=sa;pwd=;"<br /><br />sSQL = "SELECT * "<br />sSQL = sSQL & " FROM [Business Master]"<br />sSQL = sSQL & " WHERE Business LIKE Business"<br />sSQL = sSQL & " AND Address LIKE Address"<br />sSQL = sSQL & " AND Barcode LIKE Barcode"<br /><br />Buss.Open sSQL,Conn<br />Do While Not Buss.EOF<br />Response.Write "<tr><td>" & Buss("Business") & "</td><td>" & Buss("Address") & "</td><td>" & Buss("Barcode") & "</td></tr>"<br />Response.Write vbcrlf<br />Buss.MoveNext<br />Loop<br />Buss.Close<br />Conn.Close<br /><br />%><br /></TABLE><br /></BODY><br /></HTML><br /><br />Any suggestions or perhaps you can point me to where there is a sample of something similar?<br /><br />Thank you <br /><br /><br />

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