-
DTS LoadFromSQLServer
I have a DTS package which contains one Active X script(code below) that loops through a directory and passes the file names in that directory to another DTS package. When executing I receive the following error:
[DBNETLIB][ConnectionOpen (Connect().] SQL Server does not exist or access denied
I know I have the server name, user name, and password correct. Any help would be greatly appreciated
Code for Active X script below:
Function Main()
Const DTSSQLStgFlag_UseTrustedConnection = 256
Dim oPKG
Dim i
Dim sFolder
sFolder = "D: estdts"
Dim fso, f, f1, fc, s
Set fso = CreateObject("Scripting.FileSystemObject"
Set f = fso.GetFolder(sFolder)
Set fc = f.Files
For Each f1 in fc
Set oPKG = CreateObject("DTS.Package"
oPKG.LoadFromSQLServer server1,uname ,password1 , DTSSQLStgFlag_UseTrustedConnection, , , , dtstest
Set cn = oPKG.Connections("Connection 1"
cn.FileName = sFolder & f1.name
oPKG.Execute
oPKG.Uninitialize()
Set oPKG = Nothing
Next
Main = DTSTaskExecResult_Success
End Function
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|