Shedule agent not run

i hv an agent that get data from a db2 and the form is mailed…when run manully it wrks fine can u pls tell where i have done wrong my script is below.

Sub Initialize

'----------------------------------------------



Dim session As New NotesSession

Dim db As NotesDatabase

Dim doc As NotesDocument

Dim user As String





Dim form As NotesForm

Dim whenNow As String

whenNow$ = Today()



Set db = session.CurrentDatabase

’ Set Doc = Db.CreateDocument

Set doc=session.DocumentContext

Set doc=New NotesDocument(db)

Doc.Form = "frmDsaleS"



Doc.status="send"

doc.flddssdate=whenNow$

Call doc.save(True,True)







Dim conn, rs As Variant

Dim sCN As String

Dim strSQL As Variant

'Dim i As Integer, iRowCount As Integer

Dim vOrdTotal As Variant



Set Conn = createobject("ADODB.Connection")

conn.ConnectionTimeout = 30

conn.Provider = "IBMDA400"

conn.Properties("Data Source") = "192.168.80.254"

'conn.Properties("Initial Catalog") = MULTILINGUAL

conn.Properties("User ID") = "INVTEST"

conn.Properties("Password") = "INVTEST"

conn.Open



If Conn Is Nothing Then

	'Messagebox("Cound not connect to Server")

	Exit Sub

End If





qstrSQL = "SELECT ITEM,DAYQTY,WEEQTY,MONQTY,YERQTY,FREQTY FROM QGPL.SALES"



Set rs = CreateObject("ADODB.Recordset")

rs.Open QstrSQL, conn



'rs.movelast

'rs.movefirst

'If rs.IsResultSetAvailable Then

nor=rs.recordcount

	'nor=rs.NumRows



k=0



Redim IndArr(k) As Integer

Redim pepdesArr(k) As String

Redim pepdalvolArr(k)  As Double

Redim pepdalvol1Arr(k)  As Double

Redim pepdalvol2Arr(k) As Double

Redim pepdalvol3Arr(k) As Double

Redim pepfreeArr(k) As Double



		'reading the first record of the result set

'rs.CurrentRow = 1





IDes= rs.Fields("ITEM").value

daily= rs.Fields("DAYQTY").value 

mid1=rs.Fields("WEEQTY").value

mid2= rs.Fields("MONQTY").value ' mid2 

mid3= rs.Fields("YERQTY").value ' mid3 

free=rs.Fields("FREQTY").value ' free 



i =1

		'process 

While rs.EOF= False 

	

	If  k = 0 Then

		IndArr(k) = k+1

		pepdesArr(k) = IDes

		pepdalvolArr(k) = daily 

		pepdalvol1Arr(k) = mid1

		pepdalvol2Arr(k) = mid2

		pepdalvol3Arr(k) = mid3

		pepfreeArr(k) = free

		

	Else

		Redim Preserve IndArr(k) As Integer

		Redim Preserve pepdesArr(k) As String

		Redim  Preserve pepdalvolArr(k)  As Double

		Redim  Preserve pepdalvol1Arr(k)  As Double

		Redim Preserve pepdalvol2Arr(k) As Double

		Redim Preserve pepdalvol3Arr(k) As Double

		Redim Preserve pepfreeArr(k) As Double

		

		IndArr(k) =k+1

		pepdesArr(k) = IDes

		pepdalvolArr(k) = daily 

		pepdalvol1Arr(k) = mid1

		pepdalvol2Arr(k) = mid2

		pepdalvol3Arr(k) = mid3

		pepfreeArr(k) = free

		

	End If

	k=k+1

'End If

	

	i=i+1

	'rs.CurrentRow = i 

	

	IDes= rs.Fields("ITEM").value

	daily= rs.Fields("DAYQTY").value 

	mid1=rs.Fields("WEEQTY").value

	mid2= rs.Fields("MONQTY").value ' mid2 

	mid3= rs.Fields("YERQTY").value ' mid3 

	free=rs.Fields("FREQTY").value ' free 

	

	rs.movenext

Wend



Set rs=Nothing



doc.CIndex = IndArr

doc.pepdes = pepdesArr 

doc.pepdalvol=pepdalvolArr

doc.pepmidvol1=pepdalvol1Arr

doc.pepmidvol2 = pepdalvol2Arr

doc.pepmidvol3 = pepdalvol3Arr

doc.pepfree =pepfreeArr



'Else

'	Msgbox "No Payment Information for Customer Code"+" "+doc.CRLA_Cuscode(0)+" ", 48,"Validation"

'End If





Call doc.save(False,True)

conn.close



'------------------------------------------------

	user="xxx"



Call MailSend(user,"", "Daily Sales Summary report", "Visit the link below to view the Daily Sales Summary Report", doc)

’

End Sub

Subject: shedule agent not run

Hello

Can u check the server log for any errors that might have come .

Hope the agent is signed with the proper ID .

Tom

Subject: RE: shedule agent not run

when i run this manually it wrks fine,when i shedule this only thankx for the comments

the empty form is going,data from db2 is not loaded,

that means the shedule agents run, and also is signed by the admin, is it with the ado connection wheni put this line,

it dosnt go inside

dbug.LogAction(“File Updated”)

Subject: RE: shedule agent not run

also in log.nsf it says

11/15/2006 09:53:54 AMgr: Agent (‘downloadls’ in ‘apps/tmol/OLE/dbRepSalOle.nsf’) error message: Operation not supported on this platform

Subject: shedule agent not run

If you run the agent in the debugger, where is the exception thrown? Which line of code generates the error?

Shawn

Subject: shedule agent not run

Does it not run or is there an error in the process of running it ? Things to check:1. ability to run agents on the server of the agent signer

  1. server installation (do you need the db2 client enabler installed ? do you need the database you access to be cataloged on the server etc.)

Subject: shedule agent not run

I don’t know…1) You may be using some functionaluty that doesn’t work on a server;

  1. Have you checked the Agent FAQ? It usually has the answer go to Forum FAQ’s on the left hand side of this forum, then select Agent FAQ’s