Page 1 of 1

Accessing FileMaker Pro Databases

Posted: Tue Mar 06, 2012 2:29 pm
by revRider
Can LiveCode access FileMaker Pro data sources directly? And if so does anyone have example code?

Need to find, read, edit and save (found) records.

Would like to use LiveCode as a frontend to FileMaker databases without having to convert and export records.

Thanks for any comments on the matter!
~David

Re: Accessing FileMaker Pro Databases

Posted: Tue Mar 06, 2012 2:54 pm
by bangkok
revRider wrote:Can LiveCode access FileMaker Pro data sources directly? And if so does anyone have example code?

Need to find, read, edit and save (found) records.
~David
No problem.

On the machine that hosts your FM DB, create a DSN ODBC (via the Datadirect SequeLink 5,5 that should be provided with FM).

Then, on the LiveCode stack you can open the connexion, and send SQL queries (select, update etc.), in the same way than with MySQL server, SQL lite etc.

Code: Select all

put revOpenDatabase("ODBC","myfmdb",,"mylogin","mypassword") into dbID
put "SELECT * FROM MYTABLE" into dbSQL
put revDataFromQuery(,,dbID,dbSQL) into myResults
revCloseDatabase dbID
I use this scheme a lot, with FM clients 9, and FM server 9. Works perfectly (albeit watch out with date fields in where clause, can be tricky).

If you need several LiveCode clients to access one FM server on the same local network, and if you don't want to bother with ODBC setup on each client, then you can use the socket server scheme (clients send their queries to a LiveCode socket server, and then the socket server send the queries to FM, and send back the results).

Re: Accessing FileMaker Pro Databases

Posted: Wed Mar 07, 2012 12:15 am
by revRider
Oh forgot to mention, we are a Mac/Apple Shop.

Can we still use ODBC? Know I used to use ODBC back in the Day when we used Access and VisualBasic (over a decade ago!).

Thanks
~David