i have a question about searching database with ..

Results 1 to 2 of 2

Thread: i have a question about searching database with ..

  1. #1
    Join Date
    Dec 1969

    Default i have a question about searching database with ..

    3 criteria that the user can enter. On my form there is going to be a 3 textboxes.<BR><BR>first name - textbox1<BR>company - textbox2<BR>email - textbox3<BR><BR>the user can fill in whichever textbox they want to search the database for. So my problem is that if a user just fills out an email, i have to know that the other ones are empty and do a search just for email.<BR><BR>can i get help for writing the psedocode. Thanks. <BR>So far i was thinking about doing...<BR><BR>dim sql as string<BR>sql = "select * from table1 where "<BR>if tb1 &#060;&#062; "" then<BR>sql = sql & "fname = " & textbox1<BR>end if<BR><BR>if tb2 &#060;&#062; "" then<BR>sql = sql & "company = " & textbox2<BR>end if<BR><BR>if tb3 &#060;&#062; "" then<BR>sql = sql & "email = " & textbox3<BR>end if<BR><BR>but my problem is that, i want to search adding the "AND" keyword ... thank you<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default Usual answer: ASPFAQs

    Really, you should look in the ASPFAQs from time to time. There&#039;s more there than you might think.<BR><BR>http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=82

Posting Permissions

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