Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2005
    Thanked 0 Times in 0 Posts

    Syntax error in string in query expression

    I'm using Dreamweaver MX, ASP, and Access to develop a two page survey. After completing page 1, the user clicks Submit. A hidden field passes a session GUID and also inserts that GUID into a field in my Access database which holds the responses. When the browser gets to page 2, it prepares to do an update (to the record already holding the results from page 1) when the user clicks the Submit button. However, before any part of page 2 is displayed, the following error appears:

    Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
    [Microsoft][ODBC Microsoft Access Driver] Syntax error in string in query expression 'MSGUID = 'C7D38704-47CE-4E14-873D-C0D7A49C5B34}'.
    /survey/mapsurvey2.asp, line 139

    Can anyone tell me what's wrong with my code?


    Dim rsContinueSurvey
    Dim rsContinueSurvey_numRows

    Set rsContinueSurvey = Server.CreateObject("ADODB.Recordset")
    rsContinueSurvey.ActiveConnection = MM_survey_STRING
    rsContinueSurvey.Source = "SELECT MSID, MSGUID FROM TblMapSurvey WHERE MSGUID = '" + Replace(rsContinueSurvey__MMColParam, "'", "''") + "'"
    rsContinueSurvey.CursorType = 0
    rsContinueSurvey.CursorLocation = 2
    rsContinueSurvey.LockType = 1

    rsContinueSurvey_numRows = 0

  2. #2
    New to the CF scene
    Join Date
    Jan 2005
    Thanked 0 Times in 0 Posts

    Thumbs up

    I discovered a solution with some help from another forum...

    First, I got rid of the

    , MSGUID

    from the


    statement in page 2.

    Then in page 1 of the survey, I altered the generation of the GUID as such:

    MSGUID = Server.CreateObject("Scriptlet.TypeLib").GUID
    MSGUID = mid(MSGUID,2,36)

    By manipulating the GUID string, I was able to avoid the { and }s altogether.

    Probably a better way to do this but it worked.


Posting Permissions

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