Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

script to open access database & execute a update query

107 views
Skip to first unread message

Amod

unread,
Jul 23, 2008, 10:53:00 AM7/23/08
to
Hi...
I have craeted this script to open access database & execute a update query:
var AccessApp;
AccessApp = new ActiveXObject("Access.Application");
AccessApp.Visible = true;
//This line doesn't work ???
AccessApp.OpenCurrentDatabase("Z:\testDB.accdb");
AccessApp.CurrentDb.Execute("Query1");

It gives me an error in the prompt box: Automation server can't create
object. I am running this script on the server & this database resides on a
different server.
Please help.
Thanks

--
Amod Goyal
IT System Developer
NSK Precision America

Old Pedant

unread,
Jul 24, 2008, 3:24:02 PM7/24/08
to
> AccessApp.OpenCurrentDatabase("Z:\testDB.accdb");

This is JavaScript. The \ character is an "escape" character for the next
following character. As in
\n == newline
\r == return
\t == tab

So you just coded
AccessApp.OpenCurrentDatabase("Z:[tab character]testDB.accdb");

Now try

AccessApp.OpenCurrentDatabase("Z:\\testDB.accdb");

To get an actual \ in the string, you use a pair: The first one escapes the
second one.

Old Pedant

unread,
Jul 25, 2008, 2:51:19 PM7/25/08
to
DOH! on me.

You know, I looked at that three times and it "felt" wrong, but I thought it
was the chili I ate for lunch.

Good eyes!


Bob Barrows [MVP]

unread,
Jul 25, 2008, 6:34:01 PM7/25/08
to

Hmm ... I don't know why but I'm not seeing the message to which you're
replying. I've reset the newsgroup and it still doesn't come down. Just what
was pointed out to you?

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


Old Pedant

unread,
Jul 25, 2008, 7:05:01 PM7/25/08
to
Joe Fawcett wrote to me:

]] As you're the self-styled "Pedant" they actually had:
]] AccessApp.OpenCurrentDatabase("Z:[tab character]estDB.accdb");
]] <grin/>

I had left *in* the t of the \t after even saying that \t became tab.

Dunno why you don't see his msg. Sorry.

Bob Barrows [MVP]

unread,
Jul 25, 2008, 7:44:43 PM7/25/08
to

I still don't see his message ... I know the "community features" of the web
interface to the newsgroups are causing some problems the MS is working on
now. I'm not sure if that's why Joe's post is still invisible to me ...

As for what he pointed out ... yeh, BTDT :-)

Old Pedant

unread,
Jul 26, 2008, 3:57:00 PM7/26/08
to
Big diff between this post & the one Bob doesn't see:

In the one he doesn't see, when I view it via the MS newsreader, it has the
little "MVP" logo image on your post heading. Not just the letters, the
actual image. Now, patently that image doesn't work in non-HTML-based
readers, so...

???


Bob Barrows [MVP]

unread,
Jul 26, 2008, 4:19:33 PM7/26/08
to

And again, I'm not seeing the post that you are referring to. I have seen
some talk in the private newsgroups that the "community" features, such as
those responsible for displaying that mvp logo, might be responsible for the
missing posts, and that the problem is being worked on.

Joe Fawcett

unread,
Jul 27, 2008, 4:10:57 AM7/27/08
to

"Bob Barrows [MVP]" <reb0...@NOyahoo.SPAMcom> wrote in message
news:uB9Qoz17...@TK2MSFTNGP05.phx.gbl...

Tried turning off Community Features in my reader to see if it makes a
difference...

--

Joe Fawcett (MVP - XML)
http://joe.fawcett.name

Bob Barrows [MVP]

unread,
Jul 27, 2008, 8:17:57 AM7/27/08
to
Joe Fawcett wrote:
> "Bob Barrows [MVP]" <reb0...@NOyahoo.SPAMcom> wrote in message
> news:uB9Qoz17...@TK2MSFTNGP05.phx.gbl...
>> Old Pedant wrote:
>>> Big diff between this post & the one Bob doesn't see:
>>>
>>> In the one he doesn't see, when I view it via the MS newsreader, it
>>> has the little "MVP" logo image on your post heading. Not just the
>>> letters, the actual image. Now, patently that image doesn't work in
>>> non-HTML-based readers, so...
>>>
>>> ???
>>
>> And again, I'm not seeing the post that you are referring to. I have
>> seen some talk in the private newsgroups that the "community"
>> features, such as those responsible for displaying that mvp logo,
>> might be responsible for the missing posts, and that the problem is
>> being worked on.
> Tried turning off Community Features in my reader to see if it makes a
> difference...

It worked :-)

0 new messages