Search form results and data shaping

Results 1 to 2 of 2

Thread: Search form results and data shaping

  1. #1
    Join Date
    Dec 1969

    Default Search form results and data shaping

    I want to use data shaping to display the results of a user&#039;s search. I&#039;ve tried various ways of passing the form variable to the SQL statement that is part of the data shaping but have been unsuccessful so far. I can pass exact text such as WHERE PubType = &#039;Book&#039;... But I&#039;d like the where clause to look to a form control.<BR><BR>In reviewing various data shaping examples, I have not seen this done and am wondering if this is possible.<BR><BR>Any help would be greatly appreciated.<BR>Thanks.

  2. #2
    Join Date
    Dec 1969

    Default RE: Search form results and data shaping

    Post a little bit of your code including some of your form fields. If I understand you correctly, this is easy to accomplish. Lets say you have a form with 5 combo boxes (all driven from database tables)<BR><BR>You want to dynamically build a where clause based on the selections:<BR><BR>If Not Request.QueryString("BrandID") Is Nothing Then<BR> If CStr(Request.QueryString("BrandID")) &#060;&#062; "" Then<BR> If objWhereClause.Length = 0 Then<BR> objWhereClause.Append("Where BrandID = &#039;" & Request.QueryString("BrandID") & "&#039;")<BR> Else<BR> objWhereClause.Append(" AND BrandID = &#039;" & Request.QueryString("BrandID") & "&#039;")<BR> End If<BR> End If<BR>End If<BR><BR>(This is a dotNet sample, but Im sure you will get the Jist)<BR>You would do these checks for all your options and then at the end see if your where clause is empty or not. If not, append it to your SQL.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts