Launching Microsoft Access via javascript - Will not stay open

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Denis

    Launching Microsoft Access via javascript - Will not stay open

    I am trying to launch an .mdb file via javascript. I do not need to
    do anything but open the application. It is able to open the
    application but for some reason it opens and then closes. At first I
    thought it may be a permission problem as far as writing the .ldb file
    to disk, but I added every single user and gave them write permissions
    to the folder and there is still no change.
    Has anyone been able to get this to work?

    Thanks in advance.

    My code;

    var AccessApp = new ActiveXObject(" Access.Applicat ion.10");
    AccessApp.Visib le = true;
    AccessApp.OpenC urrentDatabase( "c:\\case\\case .mdb");
  • PC Datasheet

    #2
    Re: Launching Microsoft Access via javascript - Will not stay open

    Denis,

    Just curious ----

    ("c:\\case\\cas e.mdb")

    Why the double backslashes??

    Steve
    PC Datasheet


    "Denis" <pound83@hotmai l.com> wrote in message
    news:89ed8fde.0 404151150.7dde0 b05@posting.goo gle.com...[color=blue]
    > I am trying to launch an .mdb file via javascript. I do not need to
    > do anything but open the application. It is able to open the
    > application but for some reason it opens and then closes. At first I
    > thought it may be a permission problem as far as writing the .ldb file
    > to disk, but I added every single user and gave them write permissions
    > to the folder and there is still no change.
    > Has anyone been able to get this to work?
    >
    > Thanks in advance.
    >
    > My code;
    >
    > var AccessApp = new ActiveXObject(" Access.Applicat ion.10");
    > AccessApp.Visib le = true;
    > AccessApp.OpenC urrentDatabase( "c:\\case\\case .mdb");[/color]


    Comment

    • Lyle Fairfield

      #3
      Re: Launching Microsoft Access via javascript - Will not stay open

      pound83@hotmail .com (Denis) wrote in news:89ed8fde.0 404151150.7dde0 b05
      @posting.google .com:
      [color=blue]
      > I am trying to launch an .mdb file via javascript. I do not need to
      > do anything but open the application. It is able to open the
      > application but for some reason it opens and then closes. At first I
      > thought it may be a permission problem as far as writing the .ldb file
      > to disk, but I added every single user and gave them write permissions
      > to the folder and there is still no change.
      > Has anyone been able to get this to work?
      >
      > Thanks in advance.
      >
      > My code;
      >
      > var AccessApp = new ActiveXObject(" Access.Applicat ion.10");
      > AccessApp.Visib le = true;
      > AccessApp.OpenC urrentDatabase( "c:\\case\\case .mdb");
      >[/color]

      You've set a reference to the Access App. When the Javascript closes the
      reference goes out of scope. Javascript is quite meticulous about garbage
      collection. It releases the variable, and the Access application closes.

      How to solve?

      Well, if you run the code from an html file ... (hta would probably not get
      you warnings) ... and leave that file open then your access app should stay
      open.



      --
      Lyle
      (for e-mail refer to http://ffdba.com/contacts.htm)

      Comment

      • Michael Harris \(MVP\)

        #4
        Re: Launching Microsoft Access via javascript - Will not stay open

        > I am trying to launch an .mdb file via javascript. I do not need to[color=blue]
        > do anything but open the application. It is able to open the
        > application but for some reason it opens and then closes. At first I
        > thought it may be a permission problem as far as writing the .ldb file
        > to disk, but I added every single user and gave them write permissions
        > to the folder and there is still no change.
        > Has anyone been able to get this to work?[/color]


        var AccessApp = new ActiveXObject(" Access.Applicat ion.10");
        AccessApp.Visib le = true;
        AccessApp.UserC ontrol = true;
        AccessApp.OpenC urrentDatabase( "c:\\case\\case .mdb");


        --
        Michael Harris
        Microsoft.MVP.S cripting
        Sammamish WA US

        Comment

        • Steve van Dongen [MSFT]

          #5
          Re: Launching Microsoft Access via javascript - Will not stay open

          On Thu, 15 Apr 2004 20:14:33 GMT, "PC Datasheet" <spam@nospam.sp am>
          wrote:
          [color=blue]
          >"Denis" <pound83@hotmai l.com> wrote in message
          >news:89ed8fde. 0404151150.7dde 0b05@posting.go ogle.com...[color=green]
          >> I am trying to launch an .mdb file via javascript. I do not need to
          >> do anything but open the application. It is able to open the
          >> application but for some reason it opens and then closes. At first I
          >> thought it may be a permission problem as far as writing the .ldb file
          >> to disk, but I added every single user and gave them write permissions
          >> to the folder and there is still no change.
          >> Has anyone been able to get this to work?
          >>
          >> Thanks in advance.
          >>
          >> My code;
          >>
          >> var AccessApp = new ActiveXObject(" Access.Applicat ion.10");
          >> AccessApp.Visib le = true;
          >> AccessApp.OpenC urrentDatabase( "c:\\case\\case .mdb");[/color][/color]
          [color=blue]
          >Denis,
          >
          >Just curious ----
          >
          >("c:\\case\\ca se.mdb")
          >
          >Why the double backslashes??
          >
          >Steve
          >PC Datasheet[/color]

          \ is the escape character in JScript strings and regular expressions.
          IOW the character that follows the \ is treated as a literal character
          and loses any special meaning it has (if any).

          Regards,
          Steve
          --
          Please post questions to the newsgroup; everyone benefits.
          This posting is provided "AS IS" with no warranties, and confers no rights.
          Sample code subject to http://www.microsoft.com/info/cpyright.htm

          Comment

          • Lyle Fairfield

            #6
            Re: Launching Microsoft Access via javascript - Will not stay open

            "Michael Harris \(MVP\)" <mikhar at mvps dot org> wrote in
            news:ugt1FD0IEH A.3220@TK2MSFTN GP12.phx.gbl:
            [color=blue]
            > AccessApp.UserC ontrol = true;[/color]

            Excellent. I didn't know about this property.

            --
            Lyle
            (for e-mail refer to http://ffdba.com/contacts.htm)

            Comment

            • Denis

              #7
              Re: Launching Microsoft Access via javascript - Will not stay open

              Thank you very much for your help.

              This line is all that was needed.

              AccessApp.UserC ontrol = true;

              Do you know of a good reference for these methods?

              Thanks again.



              *** Sent via Developersdex http://www.developersdex.com ***
              Don't just participate in USENET...get rewarded for it!

              Comment

              Working...