Unanswered: DTS Active X - Check if recrords exist before sending output
I've written a DTS transaction that I would like to schedule as a job. I don't want it to run if there is nothing to send.
I this example below on another website and have changed the connection string to reflect my settings. The password has been stared out for security reasons. It's not the way it actually appears in the script. This keeps erroring out on line 21 saying expected end of statement.
I'm sure I'm missing something small and would really like to get this done tomorrow before I leave for the weekend. Any help would be greatly appreciated.
sConnection ="Provider=sqloledb;" & _
"Data Source=GLPT-SQL\CSI_SQL;" & _
"Initial Catalog=GLPTWEB;" & _
"User Id=sa;" & _
oOleDbConnection = New OleDb.OleDbConnection(sConnection)
mySQLCmdText = "Select Count(*) FROM [GLPTWEB].[dbo].[RunTicketDataView]"
Dim myConn As New OleDbCommand
myConn(mySQLCmdText , oOleDbConnection)
set iRowCount = myConn.ExecuteReader
If iRowCount.Value = 0 then
Main = DTSTaskExecResult_Failure
Main = DTSTaskExecResult_Success
RAISERROR only fails a DTS step if the severity is raised. I set mine to 18 like the article I've linked to above says and it worked. Thanks George for your help. I hate using ActiveX in my DTS transactions.