2 Replies Latest reply on Mar 21, 2014 3:06 AM by nilsw

    ODBC SQL Syntax



      ODBC SQL Syntax


      FileMaker Pro



      Operating system version

      windows 7

      Description of the issue

      I use a .net client to query Filemaker Pro to retrieve data and send to another system.  When I add my SQL query, I am unable to retrieve data; although my ODBC driver passes the test in the Microsoft Administrative ODBC window.

      I've tried a regular SQL statement like Select * from Contacts_db


      EXECUTESQL ("select * from Contacts_db" ; "" ; "" )

      Steps to reproduce the problem

      Created database Contacts with table Contacts_db

      Expected result

      Two rows of data in database

      Actual result

      SQL syntax error

        • 1. Re: ODBC SQL Syntax

               Germaine Thomas:

               Thank you for your post.

               From inside FileMaker Pro, create a temporary text field "TEMP", and create a button that executes the script step:

               Set Field [ TEMP ; ExecuteSQL ( "SELECT * FROM Contacts_db" ; "," ; "¶"  ]

               Although this doesn't use the ODBC Driver, the TEMP field should show all records from the Contacts_db table with each field separated by a comma, and each record separated by a return.  If this doesn't work, then somehow FileMaker is not recognizing the Contacts_db table.  Verify the spelling of the table.

               Assuming this does work, then try reinstalling the ODBC driver.and configuring it.  See pages 13-15 of the ODBC Guide at:


               Once everything is installed again, try running the SQL command.

               FileMaker, Inc.

          • 2. Re: ODBC SQL Syntax

                 Also make sure you have a table occurrence "Contacts_db" in the relationship graph as the ExecuteSQL() uses those instead of the actual base tables.