Accessing FileMaker Pro Databases

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
revRider
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 49
Joined: Sat Apr 02, 2011 4:06 pm

Accessing FileMaker Pro Databases

Post by revRider » Tue Mar 06, 2012 2:29 pm

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

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: Accessing FileMaker Pro Databases

Post by bangkok » Tue Mar 06, 2012 2:54 pm

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).

revRider
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 49
Joined: Sat Apr 02, 2011 4:06 pm

Re: Accessing FileMaker Pro Databases

Post by revRider » Wed Mar 07, 2012 12:15 am

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

Post Reply