Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: RES: RE: RES: RE: Running access macro via asp pages using vbscript


Message #1 by "Elildo Mancebo Reis" <elildo@m...> on Thu, 10 Oct 2002 19:51:55 -0300
Larry,

It's not necessary to say that you are completely right! I didn't pay
attention to the Subject, and the word "Macro" in it!

It was a terrible mistake, and I hope I didn't cause any misunderstanding to
others.

So, folks, I hope you all forgive me :))

Elildo

-----Mensagem original-----
De: Larry Woods [mailto:larry@l...]
Enviada em: quinta-feira, 10 de outubro de 2002 19:38
Para: Access ASP
Assunto: [access_asp] RE: RES: RE: Running access macro via asp pages
using vbscript


Elildo,

Access is an application that must be installed on the server if
it is to be referenced.  ADO is an access method that interfaces
with an OLEDB provider ("drivers") to interface with a database.
The type of database provider is defined in the Provider
attribute of the connection string.  In the case of a Jet
provider it might be "Microsoft.Jet.OLEDB.4.0" for example.  This
will interface with the appropriate software in the MDAC package
of database providers.  For example, in this example the
interface it the Jet Engine provider, which is ALSO used by
Access.  This is quite different than using Access with it's
Macros, Modules, Reports, and Forms, which are a part of Access,
not Jet.  On the other hand, the Jet provider CAN interface with
the Tables and Queries of an Access database.

Larry Woods MCSD, MCT
l.woods, inc.

> -----Original Message-----
> From: Elildo Mancebo Reis [mailto:elildo@m...]
> Sent: Thursday, October 10, 2002 2:45 PM
> To: Access ASP
> Subject: [access_asp] RES: RE: Running access macro
> via asp pages using
> vbscript
>
>
> Larry,
>
> Maybe I'm wrong, but I believe ADO is enough to let us
> use the database. If
> Access is not instaled you can't open it by
> double-clicking, but the
> application is able to do this.
>
> Elildo
>
> -----Mensagem original-----
> De: Larry Woods [mailto:larry@l...]
> Enviada em: quinta-feira, 10 de outubro de 2002 17:49
> Para: Access ASP
> Assunto: [access_asp] RE: Running access macro via asp
> pages using
> vbscript
>
>
> This may be a "obvious" question, but are you sure
> that Access is
> installed on the server?  Just because you can use ADO
> to access
> a Jet-based database does NOT mean that Access is installed on
> the server.
>
> Apologies if this is something that you already know...
>
> Larry Woods
>
>
> > -----Original Message-----
> > From: Jeff Forrester [mailto:jforrester@g...]
> > Sent: Thursday, October 10, 2002 3:21 PM
> > To: Access ASP
> > Subject: [access_asp] Running access macro via asp
> > pages using vbscript
> >
> >
> > I am trying to run a macro from an access database
> > that is located on a
> > web server. This macro is supposed to upload a fixed
> > with text file, using
> > specs into a pre-existing table in the database. I
> > have been trying to
> > find the answer but have been unable to find any help.
> > If you know of a
> > way to run a macro using vbscript from an asp page, I
> > would appreciate any
> > help.
> >
> > This is an example of some of the code I have tried
> to so far:
> > <%
> > dbPath = server.mappath("ourpath\-fpdb\ncci.mdb")
> > macro = "ImportMacro"
> >
> > response.write runMacro(dbPath,macro)
> >
> >
> > function runMacro(byval dbPath, byval macroName)
> >   'on error resume next
> > 	Dim A
> > 	Set A = CreateObject("Access.Application")
> > 	A.Visible = true
> > 	A.OpenCurrentDatabase(dbPath)
> > 	A.Run macroName
> > 	if err.number <> 0 then
> > 	  runMacro = "Errors:" & err.description & "<br>"
> > 	else
> > 	  runMacro = "Successful Execution of: " &
> > macroName & " in " &
> > dbpath
> > 	end if
> > 	a.CloseCurrentDatabase
> > 	a.application.Quit
> > 	set a = nothing
> > End function
> > %>
> > Let me know if you have any thoughts. Thanks








  Return to Index