By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,508 Members | 2,949 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,508 IT Pros & Developers. It's quick & easy.

Launching Microsoft Access via javascript - Will not stay open

P: n/a
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" );
Nov 12 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Denis,

Just curious ----

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

Why the double backslashes??

Steve
PC Datasheet
"Denis" <po*****@hotmail.com> wrote in message
news:89**************************@posting.google.c om...
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" );

Nov 12 '05 #2

P: n/a
po*****@hotmail.com (Denis) wrote in news:89ed8fde.0404151150.7dde0b05
@posting.google.com:
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" );


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)
Nov 12 '05 #3

P: n/a
> 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?

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
Nov 12 '05 #4

P: n/a
On Thu, 15 Apr 2004 20:14:33 GMT, "PC Datasheet" <sp**@nospam.spam>
wrote:
"Denis" <po*****@hotmail.com> wrote in message
news:89**************************@posting.google. com...
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" );
Denis,

Just curious ----

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

Why the double backslashes??

Steve
PC Datasheet


\ 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
Nov 12 '05 #5

P: n/a
"Michael Harris \(MVP\)" <mikhar at mvps dot org> wrote in
news:ug**************@TK2MSFTNGP12.phx.gbl:
AccessApp.UserControl = true;


Excellent. I didn't know about this property.

--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)
Nov 12 '05 #6

P: n/a
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!
Nov 12 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.