ActiveX script does not recognizes any properties of RecordSet obj -
12-12-2005
, 12:57 AM
Hi ....,
I 'm new to DTS and would to build a DTS package for dispatching
mails to all customers. To iterate among the number of customers, I adopted
ADODB approach to open and fetch records. But When I try to print the record
using MsgBox as rs.RecordCount, it gives me the error that it does not
recognizes the Property 'rs.RecordCount'. Then I tried with other properties
but still it displays the same type of error. Please help me understand and
solve this problem.
The following is my VB ActiveX script
Function Main()
'open the connection and for each customers dispatch mail
Dim conn, rs, cmd, Flds, adCmdStoredProcedure
adCmdStoredProcedure = 4
Set conn = CreateObject( "ADODB.Connection" )
Set rs = CreateObject( "ADODB.RecordSet")
Set cmd = CreateObject( "ADODB.Command" )
conn.Open = "Provider=SQLOLEDB.1;Data Source=machine7; Initial
Catalog=dbTest;user id = 'sa';password='sa'"
set cmd.ActiveConnection = conn
cmd.CommandText = "EXEC CustomerAddress_GetEmailAndFax"
rs = cmd.Execute
MsgBox (rs.RecordCount)
Main = DTSTaskExecResult_Success
End Function |