2 Replies Latest reply on Dec 8, 2006 11:59 AM by FasterPastor

    Director and ADOXtras

    Level 7

      Hello:
      I'm using ADOXtras and I can't get results from SQL querys.
      I use this syntax an obtain an error "comma expected"
      Do you know the correct sentence thank you.

      str="Acknowledgments"
      rst=cnn.Execute("SELECT * FROM Q WHERE [Title] = "%str%"")


        • 1. Re: Director and ADOXtras
          Level 7
          I do not use ADOxtra, but the following will work with other xtras/db's.

          - inserted directly in sql-string:
          rst=cnn.Execute("SELECT * FROM Q WHERE [Title] ='Acknowledgments'")

          - as string variable:
          str="Acknowledgments"
          rst=cnn.Execute("SELECT * FROM Q WHERE [Title] ='"&str&"'")

          (where the table in the db is named Q)




          > Hello:
          > I'm using ADOXtras and I can't get results from SQL querys.
          > I use this syntax an obtain an error "comma expected"
          > Do you know the correct sentence thank you.
          >
          > str="Acknowledgments"
          > rst=cnn.Execute("SELECT * FROM Q WHERE [Title] = "%str%"")
          >


          • 2. Re: Director and ADOXtras
            FasterPastor
            Anne

            In the answer above, note difference of single quotes surrounding criterion instead of double quotes. :-)

            In your post, it should say '%str%' instead of "%str%"

            In the 2nd example, in the answer above, there is (and/or should be) a single quote, then a double quote to close the text string, then the variable name, then a double quote to open the text string again, then a single quote, before finally reclosing the text string with a double quote.