dbTalk Databases Forums  

ActiveX component can't create object

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss ActiveX component can't create object in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
magpie1978@googlemail.com
 
Posts: n/a

Default ActiveX component can't create object - 08-17-2006 , 06:30 AM






Hi,

I'm hoping someone can help me with an error message i get in a bit of
VBScript within a DTS Package.

The error message says:
"ActiveX component can't create object : 'Dir2.Dir'

I'm using SQL Server 2000 and this bit of code has been taken from a
colleague (who is now on holiday). I am not terribly familiar to
VBScript, but nevertheless the "Dir2.Dir" does look very odd to me -
i'm not sure what type of object is trying to be created. Does anyone
know what this might be?

The full code is below:

'************************************************* *********************
' Visual Basic ActiveX Script
'************************************************* ***********************

Function Main()

DIM objImportSearch
DIM SearchPath
Dim SearchFileName
Dim objDir


SET objImportSearch = CreateObject("Scripting.FileSystemObject")
SET objDir = CreateObject("Dir2.Dir")

SearchPath = "C:\FTP Import"
SearchFileName = "*.*"

objDir.Path = SearchPath
objDir.SearchFilename = SearchFileName
objDir.GetFileName

If objDir.FilenameFound <> "" then
'' If objImportSearch.FileExists(SearchPath & "\" & SearchFileName)
then

''-------------------------------------------------------------------------------------------------
'' Set Global IMPORT FILENAME Variable
''-------------------------------------------------------------------------------------------------
DTSGlobalVariables("ImportFileName").Value = objDir.FilenameFound
Main = DTSTaskExecResult_Success
Else
Main = DTSTaskExecResult_Failure
End If
End Function


Regards,
Chris


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.