WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE with Access

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Execute a Public function in Access


Question:

I have a public function in Access "Refresh" which takes 2 parameters; database path, database name.

My script below bombs at the oApp.run line - error message missing parameters. Can someone give me a clue. Thanks

MyDb = ObjectOpen("Access.application")
oApp = MyDB.application
cmd = oapp.Docmd

dbname = "F:\Work\Test.mdb"
Mydb.openCurrentDatabase(dbname)
Mydb.visible = @false

oApp.run "Refresh("F:\Work","Test.mdb")"

Mydb.closeCurrentDatabase
oApp.quit

Answer:

Apparently the first parameter of the the Run Method is the procedurename , then each next parameters are parameters for that procedure.

Give this a try:

oApp.run("Refresh","F:\Work","Test.mdb")
The syntax is app.run (procedure, param1, param2)
Article ID:   W16098
File Created: 2004:03:30:15:42:50
Last Updated: 2004:03:30:15:42:50