Results 1 to 8 of 8
  1. #1
    Join Date
    Jun 2003
    Posts
    17

    Unanswered: Launch .fp5 file from command line w/password?

    How does one open a .fp5 file that is password-protected via the command line?

    HELP!

  2. #2
    Join Date
    Sep 2003
    Location
    Cincinnati, Oh USA
    Posts
    203

    Re: Launch .fp5 file from command line w/password?

    Never done this from a command line statement, but have done it
    if a VB front end using the ADODB.open statement. The database, as far as I know, can be opened only from within the FM app.

    Originally posted by nightowlky
    How does one open a .fp5 file that is password-protected via the command line?

    HELP!
    Rick Knight
    KnightShift Office Solutions and Horse Breaking
    VB, VBA, FileMaker, Access Solutions, Web Solutions

  3. #3
    Join Date
    Jun 2003
    Posts
    17
    You've done it from within ADODB??

    Could you post some code for that? That would work perfectly as I'm actually using WSH/VB Script to call some ODBC SQL queries against the FMPro data. I just need something to automatically launch the FMPro database before I can run the query (and then I'll use a command-line utility to kill the FMPro process.)

    TIA!

  4. #4
    Join Date
    Sep 2003
    Location
    Cincinnati, Oh USA
    Posts
    203
    Here ya go..set this inside an cmd button_click in VB This will open the db, with your password

    Set Con = New ADODB.Connection
    Set Con = New ADODB.Command

    Con.Open "Provider=MSDASQL.1;Data Source=FM_For_VB_Apps;password=Yourpasswordhere;da tabase=Yourdatabasenamehere.fp5"
    Con.CursorLocation = adUseClient



    Originally posted by nightowlky
    You've done it from within ADODB??

    Could you post some code for that? That would work perfectly as I'm actually using WSH/VB Script to call some ODBC SQL queries against the FMPro data. I just need something to automatically launch the FMPro database before I can run the query (and then I'll use a command-line utility to kill the FMPro process.)

    TIA!
    Rick Knight
    KnightShift Office Solutions and Horse Breaking
    VB, VBA, FileMaker, Access Solutions, Web Solutions

  5. #5
    Join Date
    Jun 2003
    Posts
    17
    Originally posted by RickKnight
    Here ya go..set this inside an cmd button_click in VB This will open the db, with your password

    Set Con = New ADODB.Connection
    Set Con = New ADODB.Command

    Con.Open "Provider=MSDASQL.1;Data Source=FM_For_VB_Apps;password=Yourpasswordhere;da tabase=Yourdatabasenamehere.fp5"
    Con.CursorLocation = adUseClient

    Thanks, Rick.

    I'll give that a whirl!

  6. #6
    Join Date
    Sep 2003
    Location
    Cincinnati, Oh USA
    Posts
    203
    Oops, forgot to mention that the FM database resides in the app folder (or projest folder) otherwise you'll need to add a path statement.

    Originally posted by nightowlky
    Thanks, Rick.

    I'll give that a whirl!
    Rick Knight
    KnightShift Office Solutions and Horse Breaking
    VB, VBA, FileMaker, Access Solutions, Web Solutions

  7. #7
    Join Date
    Feb 2004
    Posts
    84

    Re: Launch .fp5 file from command line w/password?

    Okay, this is fairly easy. It sounds like you already know how to launch a 'normal' unprotected FileMaker database from the command line. The part that's messing you up is the 'password' issue. This is an easy fix. I'm running under the assumption that this database really needs a password in the first place, otherwise you can go to access privledges and just get rid of them.

    Many FileMaker Pro developers will use a developer's launch file to open up databases. most of my database will only have two passwords: Normal user password and the master password. Normally I have the 'normal' FMP password automatically entered via the 'Try Password' Document Preference setting, but when I need to get in the database I have two options. The first is to press 'shift' as I am opening the database. This will prompt me for my password and ignore the 'try password' preference. This option will not work for you, because you are trying to do this 'hands-free'; therefore I move to my preferred method.

    I typically will use a 'launch file' to launch the solution. Whenever I open this empty database it automatically opens the 'real' database. The only catch is that I have my 'master' password entered as the 'automatically' entered password in the launch file. FileMaker will automatically try the same password as the original file when opening another database from within a script, so the launch file will open the database up with your permissions without giving full access to everyone.

    This launch file can be anywhere. For example it could be local on your hard drive in a folder without file sharing, and the 'real' database could be out on the network or anywhere else.

    It is important to secure this launch file, as it will give all who use it "God' rights, but this is not normally an issue.

    The launch file will have one field, one script. The script will have two steps - 1.) Perform Script External (any script from 'real' database) 2. Close database. You will need to go to doc prefs and set this script as the startup script.


    hope this helps....

  8. #8
    Join Date
    Jun 2003
    Posts
    17
    Ah...neat treat, Joe.

    What I ended up doing is just using the SendKeys command in a VBScript to send the password and the {Enter} key.

    It's working like a charm.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •