|
-
Oct 1st, 2001, 10:07 AM
#1
Thread Starter
Junior Member
DTS - please help
I have used following code to execute DTS package from VB.
The problem I am having is, that it works fine from some pc but not with others. For example it gives me error of %1 not found, but on DBO'S machine it works fine. I have SQL 7 and he has SQL 2000.
I am new at VB so please give details/more explanations or references.
Private Sub RunPackage()
'*************Code to execute DTS Package*********
'Run DTS Package to create temptbl
Dim oPKG As DTS.Package, oStep As DTS.Step, oTask As DTS.Task
Set oPKG = New DTS.Package
oPKG.LoadFromSQLServer "SERVER IP ADDR", "DATABASEUSERID", "DATABASE PASSWORD", _
DTSSQLStgFlag_Default, "package password", , , "package name"
' Set Exec on Main Thread
oPKG.Execute
Set oPKG = Nothing
'*************End of Code to execute DTS Package*********
End Sub
-
Oct 1st, 2001, 10:29 AM
#2
Fanatic Member
This was covered on another thread. There's some useful info and resources here
The liver is bad. It must be punished.
-
Oct 1st, 2001, 10:40 AM
#3
Thread Starter
Junior Member
Thank You Rsingh.. for replying.
In fact I have used that from previous thread.. but had trouble executing from VB.. can you please help me out with how I would execute this sp from VB..
-
Oct 1st, 2001, 11:23 AM
#4
Fanatic Member
When you try this on a colleages machine, do you do a full install of the application or do you just run the exe?
Also try using the stored procedure code from the other machine of the form
spRunPackage 'NameofPackage' through Query Analyzer to check that that is working.
Try the above and we'll see where are.
The liver is bad. It must be punished.
-
Oct 1st, 2001, 12:15 PM
#5
Thread Starter
Junior Member
I have used following code to execute procedure from Vb.
Private Sub RunPackage2()
Dim rsDts As New ADODB.Recordset
If OpenSQLServerConnection = False Then
MsgBox "There was an error opening the connection to SQL Server. Please call for support.", vbInformation, Me.Caption
Exit Sub
End If
Set rsDts = cn.Execute("spRunPackage '" & CheckFileImport & "'")
CloseSQLServerConnection
End Sub
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
|
Click Here to Expand Forum to Full Width
|