Showing posts with label subscriptions. Show all posts
Showing posts with label subscriptions. Show all posts

Tuesday, March 20, 2012

adding subscriptions

Hi everyone,

Im not into VB scripting...On SSNS, im trying to add subscribers and subscriptions using VBscript.
I have been successful in adding subscribers but am getting an error while trying to add subscriptions... here's my code and the error:

PS: the tutorial code doesnt help much though it is very very similar, coz it is throwing up its own errors.

'
' AddSubscriptions.vbs
'
' Add a set of subscriptions to the ********** application
'
AddSubscriptions

Function AddSubscriptions()
Dim nsInstance, nsApplication, nsSubscription
' Create NSInstance object
Set nsInstance =
WScript.CreateObject("Microsoft.SqlServer.NotificationServices.NSInstance")
nsInstance.Initialize "*******"

' Create NSApplication object
Set nsApplication =
WScript.CreateObject("Microsoft.SqlServer.NotificationServices.NSApplication")
nsApplication.Initialize (nsInstance), "**********"
' Create NSSubscription object
Set nsSubscription =
WScript.CreateObject("Microsoft.SqlServer.NotificationServices.Subscription")
nsSubscription.Initialize (nsApplication), "**********Subscriptions"

' Set common properties for all subscribers
nsSubscription.SetFieldValue "DeviceName", "myDevice"
nsSubscription.SetFieldValue "SubscriberLocale", "en-us"
' Add subscriptions
nsSubscription.SubscriberId = "******"
nsSubscription.SetFieldValue "City", "*********"
nsSubscription.Add
nsSubscription.SubscriberId = "*****"
nsSubscription.SetFieldValue "City", "*********"
nsSubscription.Add
nsSubscription.SubscriberId = "***********"
nsSubscription.SetFieldValue "City", "*********"
nsSubscription.Add
wscript.echo "Subscriptions successfully added."
End Function

ERROR MESSAGE:
Line: 25
Char: 2
Error: Specified argument was out of range of valid values.
Parameter name: subscriptionClassName
Code: 80131502
Source: MicrosoftSqlServer.NotificationServices

any help will be much appreciated!

cheers,
Sunny

Hard to tell but it looks like you may have a typo in your subscription class name.

BTW - I recently blogged about deleting subscribers using VBScript; it's not exactly what you're trying to do, but perhaps it'll help.

http://sqlns.blogspot.com/2006/04/deleting-sqlns-v20-subscribers-using.html

And here's a link to a blog where I describe how to create subscribers, devices, and subscriptions in C#.

http://sqlns.blogspot.com/2005/09/creating-subscribers-in-v20.html

HTH..

Joe

adding subscriptions

Hi everyone,

Im not into VB scripting...On SSNS, im trying to add subscribers and subscriptions using VBscript.
I have been successful in adding subscribers but am getting an error while trying to add subscriptions... here's my code and the error:

PS: the tutorial code doesnt help much though it is very very similar, coz it is throwing up its own errors.

'
' AddSubscriptions.vbs
'
' Add a set of subscriptions to the ********** application
'
AddSubscriptions

Function AddSubscriptions()
Dim nsInstance, nsApplication, nsSubscription
' Create NSInstance object
Set nsInstance =
WScript.CreateObject("Microsoft.SqlServer.NotificationServices.NSInstance")
nsInstance.Initialize "*******"

' Create NSApplication object
Set nsApplication =
WScript.CreateObject("Microsoft.SqlServer.NotificationServices.NSApplication")
nsApplication.Initialize (nsInstance), "**********"
' Create NSSubscription object
Set nsSubscription =
WScript.CreateObject("Microsoft.SqlServer.NotificationServices.Subscription")
nsSubscription.Initialize (nsApplication), "**********Subscriptions"

' Set common properties for all subscribers
nsSubscription.SetFieldValue "DeviceName", "myDevice"
nsSubscription.SetFieldValue "SubscriberLocale", "en-us"
' Add subscriptions
nsSubscription.SubscriberId = "******"
nsSubscription.SetFieldValue "City", "*********"
nsSubscription.Add
nsSubscription.SubscriberId = "*****"
nsSubscription.SetFieldValue "City", "*********"
nsSubscription.Add
nsSubscription.SubscriberId = "***********"
nsSubscription.SetFieldValue "City", "*********"
nsSubscription.Add
wscript.echo "Subscriptions successfully added."
End Function

ERROR MESSAGE:
Line: 25
Char: 2
Error: Specified argument was out of range of valid values.
Parameter name: subscriptionClassName
Code: 80131502
Source: MicrosoftSqlServer.NotificationServices

any help will be much appreciated!

cheers,
Sunny

Hard to tell but it looks like you may have a typo in your subscription class name.

BTW - I recently blogged about deleting subscribers using VBScript; it's not exactly what you're trying to do, but perhaps it'll help.

http://sqlns.blogspot.com/2006/04/deleting-sqlns-v20-subscribers-using.html

And here's a link to a blog where I describe how to create subscribers, devices, and subscriptions in C#.

http://sqlns.blogspot.com/2005/09/creating-subscribers-in-v20.html

HTH..

Joe

Thursday, March 8, 2012

Adding new subscription to SQL Server 2005s Local Subscriptions fails...

Hi everyone,

I am trying to add a new subscription to the local subscriptions of a SQL Server 2005. As soon as I click on SERVER_NAME -> Replication -> Local Replications -> New Subscription, I get the following error message:

TITLE: New Subscription Wizard
Microsoft SQL Server Management Studio is unable to access replication components because replication is not installed on this instance of SQL Server. For information about installing replication, see the topic Installing Replication in SQL Server Books Online.

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.06&EvtSrc=Microsoft.SqlServer.Management.UI.ReplUtilitiesErrorSR&EvtID=ReplicationNotInstalled&LinkId=20476
ADDITIONAL INFORMATION:

Die EXECUTE-Berechtigung wurde für das 'sp_MS_replication_installed'-Objekt, 'mssqlsystemresource'-Datenbank, 'sys'-Schema verweigert. (Microsoft SQL Server, Error: 229)
Translated from German to english:
EXECUTE-Permission for the 'sp_MS_replication_installed'-Object, 'mssqlsystemresource'-Database, 'sys'-Schema denied. (Microsoft SQL Server, Error: 229)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.1399&EvtSrc=MSSQLServer&EvtID=229&LinkId=20476
BUTTONS:

OK

Btw, I am using the SQL Server Management Studio.
Thanks,
Olcay

From the error message, it appears that the replication components are not installed on the machine. Can you install the components and try again?|||

Hi Mahesh,

they are installed. Could this be a rights related issue?

Thanks,
Olcay

|||

Yes, it is then a permissions related issue.

What user is trying to create the subscription? This user should be the dbo of the subscrber database and atleast PAL (publication access list) user on the publication and publisher database.

Adding new subscription to SQL Server 2005s Local Subscriptions fails...

Hi everyone,

I am trying to add a new subscription to the local subscriptions of a SQL Server 2005. As soon as I click on SERVER_NAME -> Replication -> Local Replications -> New Subscription, I get the following error message:

TITLE: New Subscription Wizard
Microsoft SQL Server Management Studio is unable to access replication components because replication is not installed on this instance of SQL Server. For information about installing replication, see the topic Installing Replication in SQL Server Books Online.

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.06&EvtSrc=Microsoft.SqlServer.Management.UI.ReplUtilitiesErrorSR&EvtID=ReplicationNotInstalled&LinkId=20476
ADDITIONAL INFORMATION:

Die EXECUTE-Berechtigung wurde für das 'sp_MS_replication_installed'-Objekt, 'mssqlsystemresource'-Datenbank, 'sys'-Schema verweigert. (Microsoft SQL Server, Error: 229)
Translated from German to english:
EXECUTE-Permission for the 'sp_MS_replication_installed'-Object, 'mssqlsystemresource'-Database, 'sys'-Schema denied. (Microsoft SQL Server, Error: 229)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.1399&EvtSrc=MSSQLServer&EvtID=229&LinkId=20476
BUTTONS:

OK

Btw, I am using the SQL Server Management Studio.
Thanks,
Olcay

From the error message, it appears that the replication components are not installed on the machine. Can you install the components and try again?|||

Hi Mahesh,

they are installed. Could this be a rights related issue?

Thanks,
Olcay

|||

Yes, it is then a permissions related issue.

What user is trying to create the subscription? This user should be the dbo of the subscrber database and atleast PAL (publication access list) user on the publication and publisher database.

Friday, February 24, 2012

Adding Group Subscriptions

Hi,
Can anyone let me know how to add a group in the domain to reporting
services.I tried adding email address and could easily subscribe to reports.
but when i tried to add a group by spacifying domainname\group name, it did
not work. Can anyone please help!!!
SachinI got a solution for this. All i did was to add a group email in our email
server. Reporting services lets us enter only email address .
"Sachin" wrote:
> Hi,
> Can anyone let me know how to add a group in the domain to reporting
> services.I tried adding email address and could easily subscribe to reports.
> but when i tried to add a group by spacifying domainname\group name, it did
> not work. Can anyone please help!!!
> Sachin