I've been trying to use the following VB script as ActiveX DTS package to print a report in Access ADP. When I run this, I get an error "Microsoft Access can't open the database because it is missing or opened exclusively by another user." The path indicated for the db is from the same computer running SQL. Any ideas what's I'm doing wrong?
Thanks!
Function PrintReport()
Dim objDB
Set objDB = CreateObject("Access.Application")
objDB.OpenCurrentDatabase("C:\AccessDB\MyDB.adp")
objDB.DoCmd.OpenReport "rptTemp", 0
objDB.CloseCurrentDatabase
objDB.Quit
PrintReport = DTSTaskExecResult_Success
End Function
Thanks!
Function PrintReport()
Dim objDB
Set objDB = CreateObject("Access.Application")
objDB.OpenCurrentDatabase("C:\AccessDB\MyDB.adp")
objDB.DoCmd.OpenReport "rptTemp", 0
objDB.CloseCurrentDatabase
objDB.Quit
PrintReport = DTSTaskExecResult_Success
End Function