Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2007
    Posts
    74

    Unanswered: Open a DB with ULS via vba code

    OK,

    I may be streching on this one but here goes anyway. I found some code that was written by Danny J. Lesandrini at http://www.databasejournal.com/featu...le.php/3286111 that automatically deploys a new Front End Client when a mismatch is detected. Not to oversimplify, but to make a long story short this is accomplished by launching a separate database to copy the new FE from a network location after the new version is detected. Here is the problem.

    Right after the Update database is launched (the one that does the file operations) it closes the FE so that it can replace it with the new version. Once it replaces the file it attempts to re-open the FE database and closes itself.

    The problem is that the FE database is protected with ULS.

    SO.... Here is the question.

    Is there any way to pass a username and password?

    The Update database uses the following code to open the new FE database.
    Shell strOpenClient, vbNormalFocus

    Any Ideas?
    Brent

  2. #2
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    You can also take a look at this vb script for cloning and launching front-ends (which uses a method to get the user login name). It's a lot simplier and has many advantages:
    http://www.dbforums.com/showpost.php...6&postcount=19

    Regarding the username and password, take a look at this to also help you with some ideas in the mdb/mde file:
    http://www.dbforums.com/showpost.php...0&postcount=20
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  3. #3
    Join Date
    Jun 2007
    Posts
    74
    I just realized that there is another issue.. In the code, he uses the Shell command to open the db. Since ULS is enabled, the path to the security file has the be provided as well. Oh Brother.....

    pk, I wil l look into your post as well, but I really want to figure out how to make this work if it is possible.

    Thanks,
    Brent

  4. #4
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Give the vb script a try. I guarantee you won't be dissappointed on what it does.

    The vb script is designed for users to have a shortcut to this (which you edit and save in the same folder.) Then the user just clicks on the vb script, and it will clone the mde/mdb file with the user's login name, and then launch the cloned file. It works very fast and the user doesn't see any difference in speed of clicking on a vb script verses a shortcut to the mde/mdb file. The benefits it offers though are many which you can read in the post.

    The only thing you need to do is edit the script (with NOTEPAD), change 1 line of code to reflect the new location name (LUName =) pointing to your mde/mdb file. You may want to use the UNC path and filename for this. The instructions are pretty good with it and I've never had a problem with it.

    If you mean MS Access security by ULS, it's simple, just put in the criteria in the shorctut (or in the vb script). Here's another example you can look at which uses different shell methods, some launching files which have the /wrkgrp option embedded into the shortcut. Hold the shift key down when opening the application as I hide the MSAccess information when this loads and show just the MainForm. It shows how to launch another MSAccess application, Excel, Word,etc.. from a form which has file listings. You can even create a desktop shortcut on a highlighted file. The PopulateTable form is the form you can use to repopulate the tables for the MainForm by giving it criteria for what file types.
    Attached Files Attached Files
    Last edited by pkstormy; 07-30-07 at 00:02.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  5. #5
    Join Date
    Jun 2007
    Posts
    74
    I will look into this tomorrow. Thank you for your time and response!

Posting Permissions

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