apostrophe in DB field commenting out ASP

Results 1 to 2 of 2

Thread: apostrophe in DB field commenting out ASP

  1. #1
    Join Date
    Dec 1969

    Default apostrophe in DB field commenting out ASP

    this is a very basic problem i seem to be having an inordinate amount of trouble with. a particular bit of data i&#039m pulling from my database contains an appostrophe (e.g. the word children&#039s). it appears that the VBS interpreter is interpreting this appostrophe as part of the ASP script, commenting? the rest of the statement, then erroring itself out.<BR><BR>here&#039s some code:<BR>Dim connect, query, searchget<BR><BR>&#039BR is some form data passed to this page<BR>searchget= Request.QueryString("BR")<BR>set connect = Server.CreateObject("ADODB.Connection")<BR><BR>&#0 39atlas is the name of the "DSN"<BR>connect.Open "Atlas"<BR><BR>&#039info is the name of the table in "Atlas", Bridge and<BR>&#039SubCat are fields within the table<BR>query = "SELECT Distinct SubCat FROM Info WHERE Bridge =&#039"&searchget&"&#039"<BR><BR>here&#039s the error the VBS interpreter gives:<BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80040e14&#039 <BR><BR>[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression &#039Bridge =&#039Children&#039s Products&#039&#039. <BR><BR>note: this code works fine for all fields without any appostrophes.<BR><BR>thanks in advance.

  2. #2
    Sathiya Guest

    Default RE: apostrophe in DB field commenting out ASP

    Please search for the answer int he user group so many pppl asked the question and got reply also. <BR><BR>Hint : See Replace command in VBscript it will help to solve the problem

Posting Permissions

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