Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Import Excel Data does not work 1st time, then works all time

Status
Not open for further replies.

patiya

MIS
Nov 24, 2003
23
US
Folks,

I am using ADP (2K) from end, SQL back end.

I am having a weird problem. I have a DTS Package that imports EXCEL data from Local Drive to a SQL Temporary File.

1) When I Execute the Package from the EnterPrise Manager, it always Works.

2) But when I start my ADP program (Below is the code), and Execute that DTS package from VBA, It never works (import Excel Data) 1st time, but if I re-run the same code again and again it works fine all the time. I am pulling my hair to find what is wrong... Any help will be appreciated.. (Below is my VBA Code)..
_______________________


Private Sub SimpleExecutePackage()


Dim oPKG As New DTS.Package
oPKG.LoadFromSQLServer "ImportData", , , _
DTSSQLStgFlag_UseTrustedConnection, , , , "ImportAttendance"

oPKG.Execute
oPKG.UnInitialize
Set oPKG = Nothing
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top