|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Event Registration error...question. I am trying to create an event sink that checks public folders for new messages and sends a notification to a set group of people. I have a VBS scrip that I am using that I want to run against a specific public folder. However, when I try to register the script, I get the following message: Error Commiting Transaction : -2141913026 Event Registration failure: %1 is required, but was not set. I have created the COM+ Application and registered the DLLs. This is the command I am using to try to register the event. cscript RegEvent.vbs Add “OnSave” ExOleDB.ScriptEventSink.1 “file://./backofficestorage/mydomainname.com/public folders/Departments/IS/IS Mail/NewItemAlert” -f c:\EventSinks\NewItemAlert.vbs WHERE “DAV:ishidden” = FALSE I am not sure why this is happening, but I need to figure it out if I am going to make any more event sinks. Thank you. Alan Jackson Hello Alan,
please check your registration command, try: cscript RegEvent.vbs Add "OnSave" ExOleDB.ScriptEventSink.1 "file://./backofficestorage/mydomainname.com/public folders/Departments/IS/IS Mail/NewItemAlert" -file c:\EventSinks\NewItemAlert.vbs -f "WHERE $DAV:ishidden$ = FALSE" And you should consider writing the event sink with Visual Basic, C++ or Managed code, since this will speed it up considerabily. Greetings, Henning Krause MVP - Exchange http://www.infinitec.de Show quote "Alan Jackson" <alanwjack***@hotmail.com> wrote in message news:udzzWFhkFHA.2472@TK2MSFTNGP15.phx.gbl... >I am new to creating event sinks, so please forgive the newbie > question. I am trying to create an event sink that checks public > folders for new messages and sends a notification to a set group of > people. I have a VBS scrip that I am using that I want to run against > a specific public folder. However, when I try to register the script, > I get the following message: > > Error Commiting Transaction : -2141913026 Event Registration failure: > %1 is required, but was not set. > > I have created the COM+ Application and registered the DLLs. This is > the command I am using to try to register the event. > > cscript RegEvent.vbs Add "OnSave" ExOleDB.ScriptEventSink.1 > "file://./backofficestorage/mydomainname.com/public > folders/Departments/IS/IS Mail/NewItemAlert" -f > c:\EventSinks\NewItemAlert.vbs WHERE "DAV:ishidden" = FALSE > > I am not sure why this is happening, but I need to figure it out if I > am going to make any more event sinks. Thank you. > > Alan Jackson Thank you for your prompt response. Your suggestion made it possible
for the VBS to be registered, but now the script will not run. It is as follows: <SCRIPT Language=VBScript> Sub ExStoreEvents_OnSave(ptrEventInfo, bstrURLItem, lngFlags) ' Declare variables Dim objConnection Dim objRecord Dim objMessage Dim objMap Dim strHTTPPath Dim strURL Dim strHTMLBody ' Initialize variables Set objMessage = CreateObject("CDO.Message") Set objConnection = CreateObject("ADODB.Connection") Set objRecord = CreateObject("ADODB.Record") Set objMap = CreateObject("exoledb.urlmapper") ' Check if its a new item If (lngFlags And 8) Or (lngFlags And 1) Then With objConnection ' Create ADO connection .ConnectionString = bstrURLItem .Provider = "Exoledb.DataSource" .Open ' Open ADO record Err.Clear objRecord.Open bstrURLItem, objConnection, 3 ' Convert ExOLEDB item URL into an http url strHTTPPath = objMap.ExoledbFileUrlToFilePath(bstrURLItem) strHTTPPath = objMap.FilePathtoHttpUrls(strHTTPPath)(0) strHTTPPath = LCase(strHTTPPath) ' Add opener command to URL strURL = strHTTPPath & "?cmd=Open" ' Create HTML formatted message body strHTMLBody = "<html><body>" strHTMLBody = strHTMLBody & "<br><b>A new item has been submitted.</b><br><br>" strHTMLBody = strHTMLBody & "Click the following link to open the item with your Web browser <a href=" & strURL & ">" & objRecord.Fields.Item("urn:schemas:httpmail:subject").Value & "</a>" strHTMLBody = strHTMLBody & "</body></html>"' Create and send message With objMessage ' Originator .From = "postmas***@mydomain.com" ' Recipient, either a user or a group .To = "informationservi***@mydomain.com" .Subject = "New message arrived: " & objRecord.Fields.Item("urn:schemas:httpmail:subject").Value .AutoGenerateTextBody = True .HTMLBody = strHTMLBody .Send End With ' Close record objRecord.Close ' Close connection objConnection.Close End With End If ' Tidy up Set objConnection = Nothing Set objRecord = Nothing Set objMessage = Nothing Set objMap = Nothing End Sub </SCRIPT> I will look in to writing the code in Visual Basic. I am new to COM objects and programming for them. I have done much more SQL stuff. If I make changes to the script, do I need to remove and re-register it? Thank you. I do appreciate your help. Alan Show quote > Hello Alan, > > please check your registration command, try: > cscript RegEvent.vbs Add "OnSave" ExOleDB.ScriptEventSink.1 > "file://./backofficestorage/mydomainname.com/public > folders/Departments/IS/IS Mail/NewItemAlert" -file > c:\EventSinks\NewItemAlert.vbs -f "WHERE $DAV:ishidden$ = FALSE" > > > And you should consider writing the event sink with Visual Basic, C++ > or Managed code, since this will speed it up considerabily. > > Greetings, > Henning Krause > MVP - Exchange > http://www.infinitec.de > > > "Alan Jackson" <alanwjack***@hotmail.com> wrote in message > news:udzzWFhkFHA.2472@TK2MSFTNGP15.phx.gbl... > > I am new to creating event sinks, so please forgive the newbie > > question. I am trying to create an event sink that checks public > > folders for new messages and sends a notification to a set group of > > people. I have a VBS scrip that I am using that I want to run > > against a specific public folder. However, when I try to register > > the script, I get the following message: > > > > Error Commiting Transaction : -2141913026 Event Registration > > failure: %1 is required, but was not set. > > > > I have created the COM+ Application and registered the DLLs. This > > is the command I am using to try to register the event. > > > > cscript RegEvent.vbs Add "OnSave" ExOleDB.ScriptEventSink.1 > > "file://./backofficestorage/mydomainname.com/public > > folders/Departments/IS/IS Mail/NewItemAlert" -f > > c:\EventSinks\NewItemAlert.vbs WHERE "DAV:ishidden" = FALSE > > > > I am not sure why this is happening, but I need to figure it out if > > I am going to make any more event sinks. Thank you. > > > > Alan Jackson Hello Alan,
you should do two things with your script: 1) Add the line "Option Explicit" to the first line of your script, right after the <script> tag... this ensures that you catch misspelled variables and such things. 2) Comment out the <script> tag with a ' and run the script with cscript. This will let you catch any syntax errors and such. If this does not solve your problem, try to cut down your script to a simple function that writes a line to a log file on the disk via the FileSystemObject. Greetings, Henning Krause MVP - Exchange http://www.infinitec.de Show quote "Alan Jackson" <alanwjack***@hotmail.com> wrote in message news:uRoUiYwkFHA.2472@TK2MSFTNGP15.phx.gbl... > Thank you for your prompt response. Your suggestion made it possible > for the VBS to be registered, but now the script will not run. It is > as follows: > > <SCRIPT Language=VBScript> > > Sub ExStoreEvents_OnSave(ptrEventInfo, bstrURLItem, lngFlags) > > ' Declare variables > Dim objConnection > Dim objRecord > Dim objMessage > Dim objMap > Dim strHTTPPath > Dim strURL > Dim strHTMLBody > > ' Initialize variables > Set objMessage = CreateObject("CDO.Message") > Set objConnection = CreateObject("ADODB.Connection") > Set objRecord = CreateObject("ADODB.Record") > Set objMap = CreateObject("exoledb.urlmapper") > > ' Check if its a new item > If (lngFlags And 8) Or (lngFlags And 1) Then > With objConnection > > ' Create ADO connection > .ConnectionString = bstrURLItem > .Provider = "Exoledb.DataSource" > .Open > > ' Open ADO record > Err.Clear > objRecord.Open bstrURLItem, objConnection, 3 > > ' Convert ExOLEDB item URL into an http url > strHTTPPath = objMap.ExoledbFileUrlToFilePath(bstrURLItem) > strHTTPPath = objMap.FilePathtoHttpUrls(strHTTPPath)(0) > strHTTPPath = LCase(strHTTPPath) > > ' Add opener command to URL > strURL = strHTTPPath & "?cmd=Open" > > ' Create HTML formatted message body > strHTMLBody = "<html><body>" > strHTMLBody = strHTMLBody & "<br><b>A new item has been > submitted.</b><br><br>" > strHTMLBody = strHTMLBody & "Click the following link to open the > item with your Web browser <a href=" & strURL & ">" & > objRecord.Fields.Item("urn:schemas:httpmail:subject").Value & "</a>" > strHTMLBody = strHTMLBody & "</body></html>" > > ' Create and send message > With objMessage > > ' Originator > .From = "postmas***@mydomain.com" > > ' Recipient, either a user or a group > .To = "informationservi***@mydomain.com" > .Subject = "New message arrived: " & > objRecord.Fields.Item("urn:schemas:httpmail:subject").Value > .AutoGenerateTextBody = True > .HTMLBody = strHTMLBody > .Send > End With > > ' Close record > objRecord.Close > > ' Close connection > objConnection.Close > End With > End If > > ' Tidy up > Set objConnection = Nothing > Set objRecord = Nothing > Set objMessage = Nothing > Set objMap = Nothing > End Sub > > </SCRIPT> > > > > I will look in to writing the code in Visual Basic. I am new to COM > objects and programming for them. I have done much more SQL stuff. If > I make changes to the script, do I need to remove and re-register it? > Thank you. I do appreciate your help. > > Alan > >> Hello Alan, >> >> please check your registration command, try: >> cscript RegEvent.vbs Add "OnSave" ExOleDB.ScriptEventSink.1 >> "file://./backofficestorage/mydomainname.com/public >> folders/Departments/IS/IS Mail/NewItemAlert" -file >> c:\EventSinks\NewItemAlert.vbs -f "WHERE $DAV:ishidden$ = FALSE" >> >> >> And you should consider writing the event sink with Visual Basic, C++ >> or Managed code, since this will speed it up considerabily. >> >> Greetings, >> Henning Krause >> MVP - Exchange >> http://www.infinitec.de >> >> >> "Alan Jackson" <alanwjack***@hotmail.com> wrote in message >> news:udzzWFhkFHA.2472@TK2MSFTNGP15.phx.gbl... >> > I am new to creating event sinks, so please forgive the newbie >> > question. I am trying to create an event sink that checks public >> > folders for new messages and sends a notification to a set group of >> > people. I have a VBS scrip that I am using that I want to run >> > against a specific public folder. However, when I try to register >> > the script, I get the following message: >> > >> > Error Commiting Transaction : -2141913026 Event Registration >> > failure: %1 is required, but was not set. >> > >> > I have created the COM+ Application and registered the DLLs. This >> > is the command I am using to try to register the event. >> > >> > cscript RegEvent.vbs Add "OnSave" ExOleDB.ScriptEventSink.1 >> > "file://./backofficestorage/mydomainname.com/public >> > folders/Departments/IS/IS Mail/NewItemAlert" -f >> > c:\EventSinks\NewItemAlert.vbs WHERE "DAV:ishidden" = FALSE >> > >> > I am not sure why this is happening, but I need to figure it out if >> > I am going to make any more event sinks. Thank you. >> > >> > Alan Jackson > Thank you again. I have done some debugging and I see no errors. My
script is not working though. I may have some issues with my script itself. I remove the open and close script tags completely and removed all references to sending an email. Instead, I had the script write and append to a file in the file system. This worked just fine when I ran the script on its own, but when I bound it to an event in the public folder, it did nothing. Either my COM+ object that I created in the components area is not working, or my script cannot recognize that there is something new in the public folder. I am not sure. I will continue to try to troubleshoot this, but if you have any ideas, I would be happy to hear them. Thank you. alan Show quote > Hello Alan, > > you should do two things with your script: > > 1) Add the line "Option Explicit" to the first line of your script, > right after the <script> tag... this ensures that you catch > misspelled variables and such things. 2) Comment out the <script> > tag with a ' and run the script with cscript. This will let you catch > any syntax errors and such. > > If this does not solve your problem, try to cut down your script to a > simple function that writes a line to a log file on the disk via the > FileSystemObject. > > Greetings, > Henning Krause > MVP - Exchange > http://www.infinitec.de > > > "Alan Jackson" <alanwjack***@hotmail.com> wrote in message > news:uRoUiYwkFHA.2472@TK2MSFTNGP15.phx.gbl... > > Thank you for your prompt response. Your suggestion made it > > possible for the VBS to be registered, but now the script will not > > run. It is as follows: > > > > <SCRIPT Language=VBScript> > > > > Sub ExStoreEvents_OnSave(ptrEventInfo, bstrURLItem, lngFlags) > > > > ' Declare variables > > Dim objConnection > > Dim objRecord > > Dim objMessage > > Dim objMap > > Dim strHTTPPath > > Dim strURL > > Dim strHTMLBody > > > > ' Initialize variables > > Set objMessage = CreateObject("CDO.Message") > > Set objConnection = CreateObject("ADODB.Connection") > > Set objRecord = CreateObject("ADODB.Record") > > Set objMap = CreateObject("exoledb.urlmapper") > > > > ' Check if its a new item > > If (lngFlags And 8) Or (lngFlags And 1) Then > > With objConnection > > > > ' Create ADO connection > > .ConnectionString = bstrURLItem > > .Provider = "Exoledb.DataSource" > > .Open > > > > ' Open ADO record > > Err.Clear > > objRecord.Open bstrURLItem, objConnection, 3 > > > > ' Convert ExOLEDB item URL into an http url > > strHTTPPath = objMap.ExoledbFileUrlToFilePath(bstrURLItem) > > strHTTPPath = objMap.FilePathtoHttpUrls(strHTTPPath)(0) > > strHTTPPath = LCase(strHTTPPath) > > > > ' Add opener command to URL > > strURL = strHTTPPath & "?cmd=Open" > > > > ' Create HTML formatted message body > > strHTMLBody = "<html><body>" > > strHTMLBody = strHTMLBody & "<br><b>A new item has been > > submitted.</b><br><br>" > > strHTMLBody = strHTMLBody & "Click the following link to open the > > item with your Web browser <a href=" & strURL & ">" & > > objRecord.Fields.Item("urn:schemas:httpmail:subject").Value & "</a>" > > strHTMLBody = strHTMLBody & "</body></html>" > > > > ' Create and send message > > With objMessage > > > > ' Originator > > .From = "postmas***@mydomain.com" > > > > ' Recipient, either a user or a group > > .To = "informationservi***@mydomain.com" > > .Subject = "New message arrived: " & > > objRecord.Fields.Item("urn:schemas:httpmail:subject").Value > > .AutoGenerateTextBody = True > > .HTMLBody = strHTMLBody > > .Send > > End With > > > > ' Close record > > objRecord.Close > > > > ' Close connection > > objConnection.Close > > End With > > End If > > > > ' Tidy up > > Set objConnection = Nothing > > Set objRecord = Nothing > > Set objMessage = Nothing > > Set objMap = Nothing > > End Sub > > > > </SCRIPT> > > > > > > > > I will look in to writing the code in Visual Basic. I am new to COM > > objects and programming for them. I have done much more SQL stuff. > > If I make changes to the script, do I need to remove and > > re-register it? Thank you. I do appreciate your help. > > > > Alan > > > > > Hello Alan, > > > > > > please check your registration command, try: > > > cscript RegEvent.vbs Add "OnSave" ExOleDB.ScriptEventSink.1 > > > "file://./backofficestorage/mydomainname.com/public > > > folders/Departments/IS/IS Mail/NewItemAlert" -file > > > c:\EventSinks\NewItemAlert.vbs -f "WHERE $DAV:ishidden$ = FALSE" > > > > > > > > > And you should consider writing the event sink with Visual Basic, > > > C++ or Managed code, since this will speed it up considerabily. > > > > > > Greetings, > > > Henning Krause > > > MVP - Exchange > > > http://www.infinitec.de > > > > > > > >>"Alan Jackson" <alanwjack***@hotmail.com> wrote in message > > > news:udzzWFhkFHA.2472@TK2MSFTNGP15.phx.gbl... > >>> I am new to creating event sinks, so please forgive the newbie > >>> question. I am trying to create an event sink that checks public > >>> folders for new messages and sends a notification to a set group > of >>> people. I have a VBS scrip that I am using that I want to run > >>> against a specific public folder. However, when I try to register > >>> the script, I get the following message: > > > > > >>> Error Commiting Transaction : -2141913026 Event Registration > >>> failure: %1 is required, but was not set. > > > > > >>> I have created the COM+ Application and registered the DLLs. This > >>> is the command I am using to try to register the event. > > > > > >>> cscript RegEvent.vbs Add "OnSave" ExOleDB.ScriptEventSink.1 > >>> "file://./backofficestorage/mydomainname.com/public > >>> folders/Departments/IS/IS Mail/NewItemAlert" -f > >>> c:\EventSinks\NewItemAlert.vbs WHERE "DAV:ishidden" = FALSE > > > > > >>> I am not sure why this is happening, but I need to figure it out > if >>> I am going to make any more event sinks. Thank you. > > > > > >>> Alan Jackson > > Hello Alan,
which account do you have configured in the COM+ application? Does that user account does have the right to write to the directory? Also, which matchscope have you set for the registration? DEEP, SHALLOW, EXACT or A regNY? Try to re-register the event sink with a matchscope of DEEP. Greetings, Henning Krause MVP - Exchange http://www.infinitec.de Show quote "Alan Jackson" <alanwjack***@hotmail.com> wrote in message news:OztT8lGlFHA.3568@TK2MSFTNGP10.phx.gbl... > Thank you again. I have done some debugging and I see no errors. My > script is not working though. I may have some issues with my script > itself. I remove the open and close script tags completely and removed > all references to sending an email. Instead, I had the script write and > append to a file in the file system. This worked just fine when I ran > the script on its own, but when I bound it to an event in the public > folder, it did nothing. Either my COM+ object that I created in the > components area is not working, or my script cannot recognize that > there is something new in the public folder. I am not sure. I will > continue to try to troubleshoot this, but if you have any ideas, I > would be happy to hear them. Thank you. > > alan > > > >> Hello Alan, >> >> you should do two things with your script: >> >> 1) Add the line "Option Explicit" to the first line of your script, >> right after the <script> tag... this ensures that you catch >> misspelled variables and such things. 2) Comment out the <script> >> tag with a ' and run the script with cscript. This will let you catch >> any syntax errors and such. >> >> If this does not solve your problem, try to cut down your script to a >> simple function that writes a line to a log file on the disk via the >> FileSystemObject. >> >> Greetings, >> Henning Krause >> MVP - Exchange >> http://www.infinitec.de >> >> >> "Alan Jackson" <alanwjack***@hotmail.com> wrote in message >> news:uRoUiYwkFHA.2472@TK2MSFTNGP15.phx.gbl... >> > Thank you for your prompt response. Your suggestion made it >> > possible for the VBS to be registered, but now the script will not >> > run. It is as follows: >> > >> > <SCRIPT Language=VBScript> >> > >> > Sub ExStoreEvents_OnSave(ptrEventInfo, bstrURLItem, lngFlags) >> > >> > ' Declare variables >> > Dim objConnection >> > Dim objRecord >> > Dim objMessage >> > Dim objMap >> > Dim strHTTPPath >> > Dim strURL >> > Dim strHTMLBody >> > >> > ' Initialize variables >> > Set objMessage = CreateObject("CDO.Message") >> > Set objConnection = CreateObject("ADODB.Connection") >> > Set objRecord = CreateObject("ADODB.Record") >> > Set objMap = CreateObject("exoledb.urlmapper") >> > >> > ' Check if its a new item >> > If (lngFlags And 8) Or (lngFlags And 1) Then >> > With objConnection >> > >> > ' Create ADO connection >> > .ConnectionString = bstrURLItem >> > .Provider = "Exoledb.DataSource" >> > .Open >> > >> > ' Open ADO record >> > Err.Clear >> > objRecord.Open bstrURLItem, objConnection, 3 >> > >> > ' Convert ExOLEDB item URL into an http url >> > strHTTPPath = objMap.ExoledbFileUrlToFilePath(bstrURLItem) >> > strHTTPPath = objMap.FilePathtoHttpUrls(strHTTPPath)(0) >> > strHTTPPath = LCase(strHTTPPath) >> > >> > ' Add opener command to URL >> > strURL = strHTTPPath & "?cmd=Open" >> > >> > ' Create HTML formatted message body >> > strHTMLBody = "<html><body>" >> > strHTMLBody = strHTMLBody & "<br><b>A new item has been >> > submitted.</b><br><br>" >> > strHTMLBody = strHTMLBody & "Click the following link to open the >> > item with your Web browser <a href=" & strURL & ">" & >> > objRecord.Fields.Item("urn:schemas:httpmail:subject").Value & "</a>" >> > strHTMLBody = strHTMLBody & "</body></html>" >> > >> > ' Create and send message >> > With objMessage >> > >> > ' Originator >> > .From = "postmas***@mydomain.com" >> > >> > ' Recipient, either a user or a group >> > .To = "informationservi***@mydomain.com" >> > .Subject = "New message arrived: " & >> > objRecord.Fields.Item("urn:schemas:httpmail:subject").Value >> > .AutoGenerateTextBody = True >> > .HTMLBody = strHTMLBody >> > .Send >> > End With >> > >> > ' Close record >> > objRecord.Close >> > >> > ' Close connection >> > objConnection.Close >> > End With >> > End If >> > >> > ' Tidy up >> > Set objConnection = Nothing >> > Set objRecord = Nothing >> > Set objMessage = Nothing >> > Set objMap = Nothing >> > End Sub >> > >> > </SCRIPT> >> > >> > >> > >> > I will look in to writing the code in Visual Basic. I am new to COM >> > objects and programming for them. I have done much more SQL stuff. >> > If I make changes to the script, do I need to remove and >> > re-register it? Thank you. I do appreciate your help. >> > >> > Alan >> > >> > > Hello Alan, >> > > >> > > please check your registration command, try: >> > > cscript RegEvent.vbs Add "OnSave" ExOleDB.ScriptEventSink.1 >> > > "file://./backofficestorage/mydomainname.com/public >> > > folders/Departments/IS/IS Mail/NewItemAlert" -file >> > > c:\EventSinks\NewItemAlert.vbs -f "WHERE $DAV:ishidden$ = FALSE" >> > > >> > > >> > > And you should consider writing the event sink with Visual Basic, >> > > C++ or Managed code, since this will speed it up considerabily. >> > > >> > > Greetings, >> > > Henning Krause >> > > MVP - Exchange >> > > http://www.infinitec.de >> > > >> > > >> >>"Alan Jackson" <alanwjack***@hotmail.com> wrote in message >> > > news:udzzWFhkFHA.2472@TK2MSFTNGP15.phx.gbl... >> >>> I am new to creating event sinks, so please forgive the newbie >> >>> question. I am trying to create an event sink that checks public >> >>> folders for new messages and sends a notification to a set group >> of >>> people. I have a VBS scrip that I am using that I want to run >> >>> against a specific public folder. However, when I try to register >> >>> the script, I get the following message: >> > > > >> >>> Error Commiting Transaction : -2141913026 Event Registration >> >>> failure: %1 is required, but was not set. >> > > > >> >>> I have created the COM+ Application and registered the DLLs. This >> >>> is the command I am using to try to register the event. >> > > > >> >>> cscript RegEvent.vbs Add "OnSave" ExOleDB.ScriptEventSink.1 >> >>> "file://./backofficestorage/mydomainname.com/public >> >>> folders/Departments/IS/IS Mail/NewItemAlert" -f >> >>> c:\EventSinks\NewItemAlert.vbs WHERE "DAV:ishidden" = FALSE >> > > > >> >>> I am not sure why this is happening, but I need to figure it out >> if >>> I am going to make any more event sinks. Thank you. >> > > > >> >>> Alan Jackson >> > > |
|||||||||||||||||||||||