Syntax
conn=FMopen(fname,[user,passw])
Input Parameter
fname : | | filename |
user : | | user name default is Admin |
passw : | | password; default is '' |
Output Parameter
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
- fname: The filename of the database to be opened.
- user: The username for accessing the database. The default value is "Admin".
- passw: The password for accessing the database. The default value is an empty string.
Output Results
- conn: A connector object that represents the connection to the database.
Algorithm Steps
- Set the default file extension for the database to ".fmp12".
- Initialize the JDBC connection by calling
FMinitJDBC
.
- 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
.
- If the file does not exist at
sname
, append the default extension fmext
to fname
and check again.
- If the file still does not exist, attempt to locate it in the desktop directory using
desktopdir(fname)
.
- If the file is still not found, append the default extension
fmext
again and check.
- If the file cannot be found in any location, raise an error indicating that the file was not found.
- Extract the path, name, and extension of the file using
fileparts(sname)
.
- Pause the execution for 1 second to allow any necessary processes to complete.
- Set the default username to "Admin". If a username is provided in
varargin
, use it instead.
- Set the default password to an empty string. If a password is provided in
varargin
, use it instead.
- 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