A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Need Help With Database Search Problem

  1. #1
    Member
    Join Date
    Aug 2001
    Location
    Hawaii
    Posts
    64

    Need Help With Database Search Problem

    I am building a word dictionary. I have my database populated and I am using Flash - ASP and Access. Everything worked fine until I needed to add words with the same meaning.
    For Instance:

    Aloha - hello, good bye , welcome, farewell, love, affection, or best wishes.

    A hui hou - good bye until we meet again.

    I am no expert in ASP Access and Flash for that matter but I have typed in a database field two words each followed by a comma and it worked for a regular(non-Flash) ASP photo gallery search page I was working on.
    I tried separating search words with a comma but then my search just times out. I have to type the exact same search word or phrase into Flash that is in the database field or it will not return anything.

    So what I ended up doing is duplicating my columns and calling those extra columns into Flash. So if someone does a search for good bye then Flash will query the database and return Aloha and A hui hou.

    Now his actually works fine but now none of my other words in my database will retun anything. The rest of the search terms do not work at all. So when I type in hello it just times out. If it type in gffgsd a garble of letters it will return NOT FOUND. Yet hello is in the database but just times out.
    I don't understand why it stopped reading my database tables when I added duplicate columns. I have went over my code and database. I can get this thing to work just fine as long as I only need to search ONE word with ONE meaning.
    See half working sample HERE

    Any help would be great.


    light4u
    Last edited by light4u; 03-29-2003 at 04:46 PM.
    Design & Marketing
    http://www.dreamteammedia.com

  2. #2
    Registered User
    Join Date
    Feb 2001
    Posts
    13,044
    Hi,

    would you mind posting the sql you use to search the table?

    Musicman

  3. #3
    Member
    Join Date
    Aug 2001
    Location
    Hawaii
    Posts
    64
    Sure, Thanks!


    ---------------------------------------------------------
    <%@Language="VBScript"%>

    <%
    Dim oRS, oConn

    Set oRS = Server.CreateObject("ADODB.Recordset")
    Set oConn = Server.CreateObject("ADODB.Connection")

    oConn.ConnectionString = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("dictionary.mdb")
    oConn.Open

    oRS.Open "SELECT * FROM Words", oConn, 1, 4
    oRS.Find "WordsOne = '" & UCase(Request.QueryString("WordsOne")) & "'"
    If oRS.EOF Then
    Response.Write "WordsOne=Not+Found&WordsTwo=Not+Found&WordsDeff=N ot+Found&Position=Not+Found"
    Else
    Response.Write "WordsDeff=" & Server.URLEncode(oRS("WordsDeff")) & "&WordsOne=" & Server.URLEncode(oRS("WordsOne")) & "&WordsDeff2=" & Server.URLEncode(oRS("WordsDeff2")) & "&aLinksHere=" & Server.URLEncode(oRS("LinksHere")) & "&Position=" & Server.URLEncode(oRS("Position")) & "&aLinksTwo=" & Server.URLEncode(oRS("LinksTwo")) & "&PositionTwo=" & Server.URLEncode(oRS("PositionTwo"))
    End If
    oRS.Close
    Set oRS = Nothing
    oConn.Close
    Set oConn = Nothing
    %>



    light4u
    Design & Marketing
    http://www.dreamteammedia.com

  4. #4
    Registered User
    Join Date
    Feb 2001
    Posts
    13,044
    Hi,

    I am pretty sure I would put one translation per database row, so you would have entries
    aloha - hello
    aloha - good bye
    a hui hou - good bye until we meet again

    I am also pretty sure I would use sql like that to search
    SELECT * FROM words WHERE word LIKE '%good bye%'
    SELECT * FROM words WHERE word LIKE '%good%' AND word LIKE '%bye%'

    Musicman

  5. #5
    Member
    Join Date
    Aug 2001
    Location
    Hawaii
    Posts
    64
    My code seems to be working fine. I have noted your sugestion Musicman, Thanks!
    I did however figure out why my search was NOT working but now I have another problem.

    You can see in the image above that I made duplicate columns so if any words had a duplicate meaning I would populate it's duplicate column field.

    WordsOne|WordsTwo|WordsDeff|WordsDeff2|LinksHere|L inks2 exc....
    You get the point.

    On words like hello that does not have an alternate definition or meaning I left the |WordsTwo|WordsDeff2|Links2 exc.... fields blank.

    Apparently in Access you need to fill in every field in the database or my query or it will not work. That is why my search for good bye worked so well because every columns field was filled out but hello only had the WordsOne|WordDeff|LinkksHere|Position filled out.

    Here is my new an improved problem. Is there some kind of code or symbol that I could type into an Access field that would show up invisible in Flash? I know I can hide columns from a query but I need use of all my columns because Flash uses them for different results here. So I guess I just need to tell the program that if " ' " then hide result.

    You can see in my NEW SAMPLE that I have used " ' " as my character I want to show up invisilble.

    Any ideas on how to hide results from a field if it matches a certain criteria?
    light4u
    Last edited by light4u; 03-29-2003 at 04:30 PM.
    Design & Marketing
    http://www.dreamteammedia.com

  6. #6
    Senior Member badboy_69's Avatar
    Join Date
    Oct 2000
    Location
    San Francisco
    Posts
    138
    Question light4u are you going to have the ability to search with multiple words??

    Just wondering, other then that it works nice.

    Wish I could help you.

    Badboy...

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center