Connecting Tech Pros Worldwide Forums | Help | Site Map

Launching Microsoft Access via javascript - Will not stay open

Denis
Guest
 
Posts: n/a
#1: Nov 12 '05
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.Application.10");
AccessApp.Visible = true;
AccessApp.OpenCurrentDatabase("c:\\case\\case.mdb" );

PC Datasheet
Guest
 
Posts: n/a
#2: Nov 12 '05

re: Launching Microsoft Access via javascript - Will not stay open


Denis,

Just curious ----

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

Why the double backslashes??

Steve
PC Datasheet


"Denis" <pound83@hotmail.com> wrote in message
news:89ed8fde.0404151150.7dde0b05@posting.google.c om...[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.Application.10");
> AccessApp.Visible = true;
> AccessApp.OpenCurrentDatabase("c:\\case\\case.mdb" );[/color]


Lyle Fairfield
Guest
 
Posts: n/a
#3: Nov 12 '05

re: Launching Microsoft Access via javascript - Will not stay open


pound83@hotmail.com (Denis) wrote in news:89ed8fde.0404151150.7dde0b05
@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.Application.10");
> AccessApp.Visible = true;
> AccessApp.OpenCurrentDatabase("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)
Michael Harris \(MVP\)
Guest
 
Posts: n/a
#4: Nov 12 '05

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.Application.10");
AccessApp.Visible = true;
AccessApp.UserControl = true;
AccessApp.OpenCurrentDatabase("c:\\case\\case.mdb" );


--
Michael Harris
Microsoft.MVP.Scripting
Sammamish WA US
Steve van Dongen [MSFT]
Guest
 
Posts: n/a
#5: Nov 12 '05

re: Launching Microsoft Access via javascript - Will not stay open


On Thu, 15 Apr 2004 20:14:33 GMT, "PC Datasheet" <spam@nospam.spam>
wrote:
[color=blue]
>"Denis" <pound83@hotmail.com> wrote in message
>news:89ed8fde.0404151150.7dde0b05@posting.google. 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.Application.10");
>> AccessApp.Visible = true;
>> AccessApp.OpenCurrentDatabase("c:\\case\\case.mdb" );[/color][/color]
[color=blue]
>Denis,
>
>Just curious ----
>
>("c:\\case\\case.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
Lyle Fairfield
Guest
 
Posts: n/a
#6: Nov 12 '05

re: Launching Microsoft Access via javascript - Will not stay open


"Michael Harris \(MVP\)" <mikhar at mvps dot org> wrote in
news:ugt1FD0IEHA.3220@TK2MSFTNGP12.phx.gbl:
[color=blue]
> AccessApp.UserControl = true;[/color]

Excellent. I didn't know about this property.

--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)
Denis
Guest
 
Posts: n/a
#7: Nov 12 '05

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.UserControl = 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!
Closed Thread