Question : activex script in dts to see if records are in table

i need a quick active x sript to put in the work flow properties of a dts transfer.

i am checking a table for a certian set of items.. if those items exist i want to flush them to a text file, if they dont i dont want the transfer to run.

what it is doing now is... if the data is there, then everything is fine and transfers correctly and i get my file.
however, if there is nothing in the table, then it creates a text file with 0 bytes.  which i dont want.


what i am looking for is the syntax for the following functionality


select * from table where condition=true

if .eof  then
do NOT run dts
else
run dts
endif

Answer : activex script in dts to see if records are in table

found what i was looking for

'**********************************************************************
' Visual Basic ActiveX Script
'**********************************************************************

Function Main()
    Dim objRs
    Dim objConn
    Dim strSql
    Dim strHtml
   
    Set objConn = CreateObject("ADODB.Connection")
    objConn.Open "Provider=SQLOLEDB;Data Source=(local);Trusted_Connection=yes;Initial Catalog=Northwind"
   
    strSql = "Select count(*) from table where condition"

    '--- //Method 1 : Using Execute Method of Connection Object
    '--- Set objRs=objConn.Execute(strSql)
    '--- //
   
    '*** /// OR ///****
   
    '//Method 2 : Using Execute Method of Connection Object
   
    Set objRs = CreateObject("ADODB.Recordset")
    objRs.Open strSql, objConn
    '//

Random Solutions  
 
programming4us programming4us