You can probably use Set Error Capture [on] to keep the error message from appearing and then use
Get ( LastError ) to check for successfully opening the file and thus, you can then script your own method for what to do if the attempt to access the file failed or was canceled.
Thanks for the quick response!
It appears that the EDS is logged into before any scripts are run. Additionally, the get last error doesn't gather anything. I have my StartUp script set at FileOption>SetScript trigger>OnFirstWindowOpen. The first line is "SetErrorCapure[on]". The next line is if get(lasterror) ≠ 0, then quit application. The application does not quit.
It appears that the logging into the EDS's and it's errors happen before the first script is ever run thus, I cannot verify or gather what errors occurred.
IN your script, Get ( lasterror ) would only return a nonzero value if Set Error Capture [on] produced an error.
What is "EDS"? Is this an ODBC data source?
Apologies for any use of the incorrect abbreviations. EDS is the external data source. The external datasource is another FM database.
I do understand what you're saying there. I cannot figure out a way to get an error and thus quit the app. The username/password error is not as huge of a deal as the cancel not "canceling". When cancel is pressed, the first error appears:
"The file “Test.fmp12” could not be found and is required to complete this operation." then:
"The previous script step, “Perform Script”, could not be completed because of an error. Do you wish to continue with this script?"
Finally, as expected, any field referring to the external data source's data is "field missing."
I must guess that there are fields or a portal that references the external data source data on the layout that is current when your file opens.
Use a layout that does not have such objects, (it can be a completely blank layout), and have your script use Open (file) to open the EDS files with a get last error following each Open File stin an IF step that checks the value returned.
Note: if you define identical account names and passwords in each file, the EDS files will open without asking for a password. FileMaker will open them with the current file's account name and password.
Is there any other reason a password prompt would populate on launch? I have done some testing and cannot figure out why it is prompting. I attempted the following to no avail:
- I created a new blank layout from a local test table with 0 fields. Upon launch, this is the layout that the DB goes to.
- I turned off my startup script. I also turned off my shutdown script.
- I thought maybe it had something to do with the last layout the DB was on so I closed the app on the same blank layout.
All this and upon launch, a prompt for the password to the external data sources' password is still displayed.
Using FIleMaker 13 in Windows 7, I ran the following simple test to make sure that no changes have crept in with the newer versions and to make sure that I wasn't missing any details in what I have suggested here.
I defined DB1 with a single table and a field named Test.
I opened manage|Security and specified a password for the Admin account.
I defined DB2 with a single table and a field named Test2.
I then duplicated the default layout that this process creates and added Test from DB1 to this additional layout. I then re-selected the original layout that just showed Test2.
I quit fileMaker to make sure that both files were closed.
I then re-opened DB2. No password dialog appeared and I saw the original layout--the layout I selected just before closing. But when I selected the second layout with the field from DB1 on it, a password dialog appeared.