I am trying to update a backend MS SQL Server via the “WebQuerySave” event of the ‘form’ using the following agent. I am getting the following error on the console:
“Operation is disallowed in this session”
It is breaking at
‘Set cn=createobject(“ADODB.Connection”)’
The code is working fine if I try to run it via notes client. But it is failing via browser. What additional settings do I need for the ADODB to work via web.
Sub Initialize
Dim session As NotesSession
Dim doc As NotesDocument
Set session = New NotesSession
Set doc = session.DocumentContext
Dim Connect As Variant
Dim RecordSet As Variant
Dim Qry As String
Dim cn As Variant
Print "test 1"
Set cn=createobject("ADODB.Connection")
Print "test 1"
cn.Open "DRIVER={SQL Server};SERVER=DEV;database=Prod;UID=dev;PWD=password"
Qry = |Select * from web_stat|
Set RecordSet = CreateObject("ADODB.Recordset")
RecordSet.Open Qry,cn,2,1
RecordSet.MoveFirst
For i = 1 To 10
Print Cstr(i) & " --> " & RecordSet.Fields("file_accessed").Value
RecordSet.MoveNext
Next
RecordSet.close
strSQL = "exec file_tacker"
cn.Execute (strSQL)
cn.close
End Sub