FMopen

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Filemaker
Introduced first in SolidGeometry 3.5, Creation date: 2017-02-28, Last change: 2025-09-14

opens a FileMaker Database by the FileMaker Application

Description

Tries to find the database in the working director or globally and in the desktopdir. Default extension is ".fmp12"

See Also: FMhelp , FMinitJDBC , FMgetFieldTabs , FMsqlQuery

Example Illustration

 missing image of FMopen(fname,user,passw)

Syntax

conn=FMopen(fname,[user,passw])

Input Parameter

fname: filename
user: user name default is Admin
passw: password; default is ''

Output Parameter

conn: connector.

Examples

Open a database using the system and try to connect using JBDC Driver
conn=FMopen('FileMakerTestBase.fmp12','user','passw')




Copyright 2017-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

This algorithm is designed to open a FileMaker database using the FileMaker application. It attempts to locate the database file in the current working directory, globally, or in the desktop directory. The default file extension for the database is ".fmp12".

Input Parameters

Output Results

Algorithm Steps

  1. Set the default file extension for the database to ".fmp12".
  2. Initialize the JDBC connection by calling FMinitJDBC.
  3. Check if the file specified by fname exists in the current directory using which(fname). If it exists, assign its path to sname. Otherwise, assign fname to sname.
  4. If the file does not exist at sname, append the default extension fmext to fname and check again.
  5. If the file still does not exist, attempt to locate it in the desktop directory using desktopdir(fname).
  6. If the file is still not found, append the default extension fmext again and check.
  7. If the file cannot be found in any location, raise an error indicating that the file was not found.
  8. Extract the path, name, and extension of the file using fileparts(sname).
  9. Pause the execution for 1 second to allow any necessary processes to complete.
  10. Set the default username to "Admin". If a username is provided in varargin, use it instead.
  11. Set the default password to an empty string. If a password is provided in varargin, use it instead.
  12. Create a database connection using the database function with the specified username, password, and JDBC driver. The connection string is constructed using the file name n.
Algorithm explaination created using ChatGPT on 2025-08-19 08:01. (Please note: No guarantee for the correctness of this explanation)

Last html export of this page out of FM database by TL: 2025-09-21