Results 1 to 9 of 9
  1. #1
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820

    Unanswered: help with VB shell

    this isn't a strictle access question but i'm trying to allow users runtime access to an access database, access 2002/10/XP what ever you want to call it has a /runtime command tag that allows to to create a legal unliecenced copy of access (basically it will run a db but can't edit structure) now i have a simple (or so i thought) program that runs the runtime install program and copies the the shortcut with the /runtime tag

    Code:
    Private Sub Command1_Click()
        Dim dbl As Double
        If HaveAccess = 0 Then
            Call Shell("J:\drivers\access~1\ACCESSRT.MSI", vbNormalFocus)
            Call Shell("copy 'j:\Health~1\H&Sdat~1\lnkfiles\H&S2.lnk' 'c:\windows\desktop\H&S.lnk'")
        Else
            Call Shell("copy 'j:\Health~1\H&Sdat~1\lnkfiles\H&S1.lnk' 'c:\windows\desktop\H&S.lnk'")
        End If
    End Sub
    now when i run it i get a "invalid procedure call or argument" error on the Call Shell("J:\drivers\access~1\ACCESSRT.MSI", vbNormalFocus) line note "J:\drivers\access~1\ACCESSRT.MSI" works perfectly in a dos box

    can anyone tell me what's wrong?
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  2. #2
    Join Date
    Oct 2002
    Location
    Rochester, NY
    Posts
    84
    Welllllllll, that depends ...

    I'm pretty sure you have to have the Microsoft Office Developer Edition to do what you're trying to do. I have a pretty good reference on Access 2000 that describes what you're trying to do and what you have to have to do it, but it is at work. I know you're in a different time zone than I am, so if you'll be patient, I'll check into it tomorrow morning and post back.

    By the way, sorry I was so long away - project deliverables and project managers !@?XX*
    Regards,
    Terry

  3. #3
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    yes my boss just dumped a copy of OXPD on my desk and said "This'll let us put databases on everyones PC with out royalties, do it.", i've managed the processes manualy and it works perfectly now i want to automate it for users who are a little technophobic to say the least
    Last edited by m.timoney; 12-13-02 at 05:28.
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  4. #4
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    my bos got a bit of a shock recently when someone pointed out that a certain piece of software only had a ten user liecence not the unlimited one he thought it had and is now in a panic about having to pay 500,000 to get the extra 90 licences (only avalable if you upgrade the product as well) and now wants to make certain that all other licences aren't over used
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  5. #5
    Join Date
    Oct 2002
    Location
    Rochester, NY
    Posts
    84
    Originally posted by m.timoney
    yes my boss just dumped a copy of OXPD on my desk and said "This'll let us put databases on everyones PC with out royalties, do it.", i've managed the processes manualy and it works perfectly now i want to automate it for users who are a little technophobic to say the least
    OK, it sounds like you have what you need (from a tools perspective) to deploy a run-time copy of Access. I have no experience with the XP version of Office, so I'm going to give you what I know about 2000.

    Using the Office Developer Tools, you can create a deployment package. Your deployment package will need to contain the MSACCESS.EXE databse engine. When you create your deployment package, the file will be added to the application distribution file (CAB file) so it can be installed on each user's PC, if they don't have Access installed. The deployment script should take care of setting the proper registry key so that Access only runs as a run-time executable on the deployment target machines.

    My suggestion for you is that you find a good technical reference for how to use the Package Deployment Wizard (or it's XP equivalent) and follow the instructuons there. I use a book written by Allison Balter called "Mastering Microsoft Access 2000 Development" published by SAMS. I would be surprised if there isn't a version of this out for XP. Balter's work is pretty good and has helped me out of many self-induced jams. I recommend it highly. Good Luck!
    Regards,
    Terry

  6. #6
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    sorry if i'm not being clear but the afore mentioned "J:\drivers\access~1\ACCESSRT.MSI" is the packaging wizards install program for access runtime what i'm trying to do is write a tiny exe file that runs the above program and copies the short cut if they don't already have access and copies the other shortcut if they do

    new problem "J:\drivers\access~1\ACCESSRT.MSI" when typed into win2000 command prompt does what i want it to do but in a win98 dos box it says can't find file even though "dir ACCESSRT.MSI" while in "J:\drivers\access~1\" displays the file no problem

    basic what i need is the ability to tell the computer to run a program and copy a file in a VB enviroment that is back compatable to win98 from 2000
    Last edited by m.timoney; 12-13-02 at 13:22.
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  7. #7
    Join Date
    Jan 2003
    Posts
    126

    Re: help with VB shell

    Originally posted by m.timoney
    this isn't a strictle access question but i'm trying to allow users runtime access to an access database, access 2002/10/XP what ever you want to call it has a /runtime command tag that allows to to create a legal unliecenced copy of access (basically it will run a db but can't edit structure) now i have a simple (or so i thought) program that runs the runtime install program and copies the the shortcut with the /runtime tag

    Code:
    Private Sub Command1_Click()
        Dim dbl As Double
        If HaveAccess = 0 Then
            Call Shell("J:\drivers\access~1\ACCESSRT.MSI", vbNormalFocus)
            Call Shell("copy 'j:\Health~1\H&Sdat~1\lnkfiles\H&S2.lnk' 'c:\windows\desktop\H&S.lnk'")
        Else
            Call Shell("copy 'j:\Health~1\H&Sdat~1\lnkfiles\H&S1.lnk' 'c:\windows\desktop\H&S.lnk'")
        End If
    End Sub
    now when i run it i get a "invalid procedure call or argument" error on the Call Shell("J:\drivers\access~1\ACCESSRT.MSI", vbNormalFocus) line note "J:\drivers\access~1\ACCESSRT.MSI" works perfectly in a dos box

    can anyone tell me what's wrong?

    If you use something like this it'll work just fine.

    RunThis = "cmd /c copy c:\test\1.txt + c:\test\2.txt c:\test\shelltest.txt"

    Set WshShell = CreateObject("WScript.Shell")
    WshShell.Run RunThis, 3, False

  8. #8
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    that covers the copy how about running the "J:\drivers\access~1\ACCESSRT.MSI" install program?

    gee i'd given this thread up as a lost cause
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  9. #9
    Join Date
    Jan 2003
    Posts
    126
    Glad I could help!

    I wonder if you used: "cmd /c start J:\drivers\access~1\ACCESSRT.MSI"

    It might fire off the install. That or you would need to run the installer and pass that as the argument.

    It's worth giving it a try anyway!

    Ken

Posting Permissions

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