Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
inet
active_desktop
active_scrptng
asp.components
asp.db
asp.general
comctl32
comp.packaging
components.dev
dbweb
dhtml_editing
docobjects
html_authoring
html_objmodel
iis
iis.ftp
iis.security
iis.smtp_nntp
indexserver
misc
mshtml_hosting
scripting.jscript
scripting.vbscript
sdk_setup
shell_objmodel
urlmonikers
webbrowser_ctl
wininet
  
 
date: Thu, 27 Mar 2008 22:18:16 +0000,    group: microsoft.public.inetsdk.programming.scripting.vbscript        back       


running subroutines inside an access module using vbs?   
I've got a vbs to run some queries inside an access database, now I'd 
like it to also run a subrutine held inside onr of the modules in the 
database. Can this be done, if so how?

The script as it stands is

Set conn = WScript.CreateObject( "ADODB.Connection" )
conn.Open "Driver={Microsoft Access driver (*.mdb)};Dbq=K:\my 
databases\db1.mdb"

conn.Execute("query2")
conn.Execute("query1")

conn.Close
Set conn = Nothing


howard
date: Thu, 27 Mar 2008 22:18:16 +0000   author:   Howard

Re: running subroutines inside an access module using vbs?   
Howard wrote:
> I've got a vbs to run some queries inside an access database, now I'd
> like it to also run a subrutine held inside onr of the modules in the
> database. Can this be done, if so how?
>
> The script as it stands is
>
> Set conn = WScript.CreateObject( "ADODB.Connection" )
> conn.Open "Driver={Microsoft Access driver (*.mdb)};Dbq=K:\my
> databases\db1.mdb"
>
> conn.Execute("query2")
> conn.Execute("query1")
>
> conn.Close
> Set conn = Nothing

You cannot do it via ADO: Access modules are only visible to the Access 
application. You will need to Automate Access and use the Application 
object. See the Access online help for details.

-- 
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"
date: Thu, 27 Mar 2008 18:35:07 -0400   author:   Bob Barrows [MVP] com

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us