Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Aug 2002
    Location
    Tillicoultry, Clackmannanshire, Scotland
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ASP from Access 2000 Query (Access2000 SR1)

    ASP generated from database query containing wildcards fails to load and times out.
    I have generated ASP from a query which has a filter in one column ( Like "*bone*" ) the field being filtered may have data such as (bone) or (bone, charcoal) or (ash, bone, charcoal) etc. This filter pulls all the records containing bone in any combination.

    However, the ASP fails to load and the script times out . I have removed wildcards from other queries and this has solved the problem but on some I cannot remove the wildcard, or at least I can't find a way to pull the same records without using them.

    Is there any way to modify the filter in the DB to prevent this problem with ASP.

    Seoras

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: ASP from Access 2000 Query (Access2000 SR1)

    When you are using ASP, I'm not sure I understand you use of the term filter. In the ASP enviornment, you use fully formed SQL statements, so do you have a WHERE clause in the SQL that includes the Like criteria?
    Wendell

  3. #3
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: ASP from Access 2000 Query (Access2000 SR1)

    Not sure what "generated ASP from a query" exactlly signifies, w/o more details only thing I can suggest is that if you are using ADO to generate a recordset, you have to use the "standard" SQL wildcard character, which is a percent sign (%), not an asterisk (*). So in the SQL statement being used to "generate ASP", you may want to try replacing the asterisks with percent signs. Other than that, have no suggestions, as do not have very much experience with ASP.

    HTH

  4. #4
    New Lounger
    Join Date
    Aug 2002
    Location
    Tillicoultry, Clackmannanshire, Scotland
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ASP from Access 2000 Query (Access2000 SR1)

    In the Access DB I have a query which uses ( Like "*Bone*" ) to pull out all records with Bone in the that particular column.

    In Access I exported the query as an ASP. But the ASP fails to load in the browser and times out. I knew this had something to do with the wildcard * used in the Access DB but did not know how to resolve it.

    I have now edited the exported ASP and replaced all * in the SQL statement with % and this has solved the problem.

    I still cannot understand why Access uses * as a wildcard in a query but if you export the query as ASP it still uses the * .

    Cheers
    Seoras

  5. #5
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: ASP from Access 2000 Query (Access2000 SR1)

    The main explanation for this is, ASP uses ADO, and ADO uses standard ANSI SQL rather than Jet SQL used by Access. See MSKB article 162977:

    ACC97: ASP Query Cannot Be Used with the LIKE Predicate

    Article states in part:

    CAUSE:
    "Because ASP files use ActiveX Data Objects (ADO) to communicate with ODBC drivers in order to query the back-end data, the SQL statements they contain have different character requirements than typical Microsoft Access SQL statements. ASP files use the percent sign (%) as a wildcard character in SQL statements whereas Microsoft Access uses the asterisk (*). "

    RESOLUTION:
    "Edit the SQL statements in the ASP files so that they use the percent sign (%) for wildcards. If parameter queries with wildcards are exported, edit the SQL statements in the ASP file so that they use the percent sign (%) as the wildcard along with the correct sequence and number of delimiters around the wildcard."

    See article for more details. Also see Access Help topics, "Comparison of Microsoft Jet SQL and ANSI SQL" and "Using Wildcard Characters in String Comparisons" for further explanation. Recommend use the ANSI wildcard characters (% and _ ) for any SQL that is being used for ASP pages.

    HTH

Posting Permissions

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