Wednesday, March 7, 2012

Run a MS Access Sub from DTS pkg??

Does anyone have any experience with running an Access subroutine from a DTS package (vbscript)? I've tried using the Call function & get the following error. (also tried changing the sub to a function, but still get the error)

Error Source: DAO Properties

Error Description: Error Code 0
Error Source = Microsoft VBScript runtime error
Error Description: Type Mismatch: 'Att4Sum2'

Error on Line 8

Property not found.

Here's my vbscript code in the DTS package:

Function ExportAttachmentData()
Dim objDB
Set objDB = CreateObject("Access.Application")
objDB.OpenCurrentDatabase("C:\DBReports.mdb")
Call Att4Sum2
objDB.CloseCurrentDatabase
objDB.Quit
ExportAttachmentData = DTSTaskExecResult_Success
End Function

Thanks!
Brianbump bump bump

No comments:

Post a Comment