SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Jul 2002
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Search access database with a form (help required)

    I have a form to search my database which I created in FP2000 (DRW). However, I think the code is completly wrong. I would be most grateful if someone can guide me in the right direction here.

    I have 4 search entries to quiry the database and they are: (language from), (language to), (area) and (Name).

    What I want them to search in the database is as follows:

    language from = search in database under fields (languagefrom1,languagefrom2,languagefrom3) for a match.

    language to = search in database under fields (languageto1,languageto2) for a match.

    area = search in database under fields (area1, area2 through to area8) for a match.

    name = Search under name field

    The code that i have now is:

    fp_sQry="SELECT * FROM Results WHERE (Translatefrom1 LIKE '%::Translatefrom1::%' OR Translatefrom2 LIKE '%::Translatefrom2::%' OR Translatefrom3 LIKE '%::Translatefrom3::%' AND Translateto1 LIKE '%::Translateto1::%' OR Translateto2 LIKE '%::Translateto2::%' AND Area1 LIKE '%::Area1::%' OR Area2 LIKE '%::Area2::%' OR Area3 LIKE '%::Area3::%' OR Area4 LIKE '%::Area4::%' OR Area5 LIKE '%::Area5::%' OR Area6 LIKE '%::Area6::%' OR Area7 LIKE '%::Area7::%' OR Area8 LIKE '%::Area8::%' AND Name LIKE '%::Name::%')"
    fp_sDefault="Translatefrom=NULL&Translateto=NULL&Area=NULL&Name=NULL"

    And the code for the form is:

    <td><input TYPE="TEXT" NAME="Translatefrom" VALUE="<%=Request("Translatefrom1")%>" size="20"></td>
    <tr>
    <td><input TYPE="TEXT" NAME="Translateto" VALUE="<%=Request("Translateto1")%>" size="20"></td>
    </tr>
    <tr>
    <td><input TYPE="TEXT" NAME="Area" VALUE="<%=Request("Area1")%>" size="20"></td>
    </tr>
    <tr>
    <td><input TYPE="TEXT" NAME="Name" VALUE="<%=Request("Name")%>" size="20"></td>

    Thanks you in advance for any help

  2. #2
    The doctor is in... silver trophy MarcusJT's Avatar
    Join Date
    Jan 2002
    Location
    London
    Posts
    3,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you're trying to do what I think you're trying to do, then that's never going to work.

    However, I may have the wrong end of the wrong stick (!!) so perhaps you could elaborate on exactly what you're trying to do!!
    MarcusJT
    - former ASP web developer / former SPF "ASP Guru"
    - *very* old blog with some useful ASP code

    - Please think, Google, and search these forums before posting!


Bookmarks

Posting Permissions

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