dbTalk Databases Forums  

ActiveX script does not recognizes any properties of RecordSet obj

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss ActiveX script does not recognizes any properties of RecordSet obj in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Hemant
 
Posts: n/a

Default 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


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.