all groups > sql server dts > april 2004 >
You're in the

sql server dts

group:

activex script to supply access file



activex script to supply access file dk
4/12/2004 4:12:17 PM
sql server dts: a dts package tries to use an activex script
to change the file name of a connection
to an access database. The activex script
fails. this is the script - any idea what is wrong?

Function Main()

Dim objFSO, strFullNm
Set objFSO = CreateObject
("Scripting.FileSystemObject")

strFullNm = DTSGlobalVariables("MDB
Filename").Value

if objFSO.FileExists(strFullNm) Then
MsgBox strFullNm + "Exists"

Dim oConn

Set oConn =
DTSGlobalVariables.Parent.Connections
("Reconciliation_History")
oConn.DataSource = DTSGlobalVariables("MDB
Filename").Value

Set oConn = Nothing


Main = DTSTaskExecResult_Success
else
MsgBox strFullNm + "Nope"
Main = DTSStepScriptResult_Failure
end if

Set objFSO = nothing


End Function


tia,
Re: activex script to supply access file Sue Hoegemeier
4/12/2004 10:32:35 PM
Other than having to change the not exists execution result
to:
Main = DTSTaskExecResult_Failure
it runs fine on my end. So if you are sure you are pointing
to a valid path to an Access database, you should check the
Global Variable name and how you are setting this value. You
could just add a MsgBox strFullNm to see what it is after
you set the variable.
You'd also want to make sure your Access connection is named
Reconcilliation_History.

-Sue

On Mon, 12 Apr 2004 16:12:17 -0700, "dk"
[quoted text, click to view]
AddThis Social Bookmark Button