Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 call stored procedure from vbscript DTS activeX

Author  Topic 

andrthad
Starting Member

19 Posts

Posted - 2005-12-09 : 00:05:29
Hi All,

Some reason I am having no luck calling a stored procedure in an ActiveX vbscript code. See code below. Any Ideas why it is not working. I've already checked permissions inside SQL Server.


Function Main()
dim conn, strSQL
set conn = CreateObject("ADODB.Connection")
conn.provider="sqloledb"
conn.Mode = "3"
conn.open "botbarapp04", "weblogin", "letmein"
conn.DefaultDatabase = "Navigator"

'****************************************************************
'Delete Old Data

conn.Execute "DELETE tblMasterClassification"
conn.Execute "DELETE tblSAPCostGeneralDescription"

'****************************************************************
'Add New Data to tblMasterClassification & tblSAPCostGeneralDescription
conn.Execute "INSERT INTO tblMasterClassification (Prod_No, BOT_No, Char_Desc, Char_Value) SELECT F1, F2, F3, F4 FROM tblImportTRSVData"

conn.Execute "INSERT INTO tblSAPCostGeneralDescription (Prod_No, Gen_Desc, Std_Cost, Last_Recost, Status) SELECT F1, F2, F5, F13, F16 FROM tblImportCostData"


'****************************************************************
'Delete Duplicate Data in tblSAPCostGeneralDescription
conn.Execute "sp_DeleteCostDuplicates"

'****************************************************************
'Housekeeping
conn.Close
Set conn = Nothing
Main = DTSTaskExecResult_Success
End Function


khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2005-12-09 : 00:27:52
try
conn.Execute "exec sp_DeleteCostDuplicates" 


-----------------
[KH]

Guys, where are we right now ?
Go to Top of Page

andrthad
Starting Member

19 Posts

Posted - 2005-12-09 : 15:00:23
Thanks, but it didn't work. Any other suggestions?
Go to Top of Page

sql4u
Starting Member

1 Post

Posted - 2009-06-15 : 18:19:24
quote:
Originally posted by andrthad

Thanks, but it didn't work. Any other suggestions?


try conn.open "EXEC sp_DeleteCostDuplicates"

it should work. It works for me.
Go to Top of Page
   

- Advertisement -