Is there any way to set it such that in my startup script for the primary database, it will open the related file with a certain set of credentials (in this case, guest credentials), but when i try to access the related database normally, it still asks for credentials?
I'm not 100% certain what you're asking here, but if you put the same credentials in the parent database as in the related database, when the relationship needs something, it will automatically pass its credentials along. Which means, in this scenario, if you put the guest credentials in the parent database and log in with those, it will log into the related database as a guest.
Where you have an issue is if the related database is already open and you want to do something that requires more than guest level access. In such a case, it'll still be open as a guest, which will not be what you want. So one solution would be to use the Re-Login script step as part of your OnFirstWindowOpen script to force the database to ask for credentials. You could do something like this:
If [ Get ( CurrentAccountPrivilegeSetName ) = "[Guest]"
Re-Login [ ]
That way, if the user logged into the related database as something else, it wouldn't trigger a second login.
If this doesn't answer your question, please elaborate and we'll try again.
Do you have all the exact same users and privilege sets in both files? If the file is an external FileMaker data source it should be fine even with a guest account.
I have had this happen if the external data source is ODBC and you do not choose to save the credentials.
the account name in both files must match and the account in the secondary file must be assigned to a privilege set that allows whatever you are trying to do.