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
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"