dbTalk Databases Forums  

error 0. syntax error

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


Discuss error 0. syntax error in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
TG
 
Posts: n/a

Default error 0. syntax error - 09-29-2006 , 01:52 PM






Hi!

I would really appreciate any help on this.

I am getting error 0. syntax error in the following activex:

Function Main()

'Const DTSSQLStgFlag_UseTrustedConnection = 256

Dim oPKG
Dim i
Dim sFolder
Dim oPKGb
Dim ib
Dim sFolderb
sFolder = "E:\Run\"
Dim fso, f, f1, fc, s
Dim fsob, fb, f1b, fcb, sb
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(sFolder)
Set fc = f.Files
For Each f1 in fc
if right(f1.name,3) = "CLM" then
Set oPKG = CreateObject("DTS.Package")
oPKG.LoadFromSQLServer ".", , , 256, , , , "Load_Claims"
Set cn = oPKG.Connections("Text File (Source)")
cn.DataSource = sFolder & f1.name
oPKG.Execute
oPKG.Uninitialize()
Set oPKG = Nothing
sFolder = "E:\Run\"

Set fsob = CreateObject("Scripting.FileSystemObject")
Set fb = fsob.GetFolder(sbFolder)
Set fcb = fb.Files
For Each f1b in fcb
if f1b.name = left(f1.name,8) + '.SRV' then
Set oPKGb = CreateObject("DTS.Package")
oPKGb.LoadFromSQLServer ".", , , 256, , , , "Load_Services"
Set cnb = oPKGb.Connections("Text File (Source)")
cnb.DataSource = sbFolder & f1b.name
oPKGb.Execute
oPKGb.Uninitialize()
Set oPKGb = Nothing
sbFolder = "E:\Run\"
end if

Next
end if
Next
Main = DTSTaskExecResult_Success
End Function



This is supposed to loop through the folder e:\run first to find .clm
and after to find the same file name but with extension.srv.

Thanks!


T


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.