I'm using an activeX script to do some conditional logic, if there are records in the Delta_INV_INFO table it exits with DTSTaskExecResult_Success. The problem is that I get the msg box for number for records read but the next task on the success path doesn't get executed:
Can you tell me why it doesn't work and what is the solution?
Thanks,
-d
Code:
'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************
Function Main()
dim myConn
dim myRecordset
dim iRowCount
' instantiate the ADO objects
set myConn = CreateObject("ADODB.Connection")
set myRecordset = CreateObject("ADODB.Recordset")
' set the connection properties to point to the Northwind database,
' using the Customers table
myConn.Open = "Provider = MSDASQL.1;Persist Security Info=True;Data Source=Pubs;"
mySQLCmdText = "Select 'rowcount' = Count(*) from DELTA_INV_INFO"
myRecordset.Open mySQLCmdText, myConn
set Flds = myRecordset.Fields
set iRowCount = Flds("rowcount")
If iRowCount.Value = 0 then
msgbox "No Records Read"
Main = DTSTaskExecResult_Failure
Else
MsgBox "The number of records is: " & iRowCount.Value
Main = DTSTaskExecResult_Success
End If
End Function
Can you tell me why it doesn't work and what is the solution?
Thanks,
-d