1 Reply Latest reply on Apr 20, 2016 6:01 AM by coherentkris

    Accessing FileMaker Pro v6 database from C#


      I am attempting to open and access a FileMaker Pro v6 database via C# and have been unable to establish a valid connection to the database - when executing, I receive the following error:


      ERROR [HY000] [FileMaker][ODBC FileMaker Pro driver][FileMaker Pro]Connect failed

      I have tried several variations of the code and have tried several variations of creating the ODBC DSN.

      Thought this would be an easy one. 

      If anyone has any step by step instructions on how to set this up, PLEASE pass them along.  I'm feeling like some of this (all of this?) issue is more related to the ODBC DSN set-up vs. code.

      Many thanks!!!



      Attempt #1

                      using (var conn = new OdbcConnection("dsn=MyFM;uid=user;pwd=xxx"))



                          using (var cmd = conn.CreateCommand())


                              cmd.CommandText = "SELECT * FROM MyFM";

                              using (var reader = cmd.ExecuteReader())





      Attempt #2

                  OdbcConnection conn = null;

                  OdbcCommand cmd = null;

                  OdbcDataReader dr = null;


                  string temp = "";




                      conn = new OdbcConnection("DSN=MyFM");


                      cmd = new OdbcCommand("SELECT * FROM \"MyFM.fp5\"");

                      cmd.Connection = conn;

                      dr = cmd.ExecuteReader();