|
Posted by Gijs Beukenoot on 10/01/58 11:19
Sort of Simon,
I'm having difficulty to get the returnset from EnumAllSubscriptions in
a workable object. It just returns nothing or won't compile.
In the code I've added, I managed to get the right call for the
EnumAllSubscriptions but I'm not sure on the syntax it requires. Like :
Dim oSubscription as SQLDMO.Subscriber2
Dim oSubscriptionData as SQLDMO.<??>
For each oSubscriptiondata in
oSubscription.EnumAllSubscribers(SQLDMOSubscription_All)
OR do I need to make something like
Dim Result
Dim oSubscription as SQLDMO.Subscriber2
Result = oSubscription.EnumAllSubscribers(SQLDMOSubscription_All)
and then walk that Result for the correct data
Thanks anyway. I'll give this a try in the .repication group.
GB
Simon Hayes bracht volgend idée uit :
> I'm not sure what you're asking - do you mean that you know that
> EnumAllScubscriptions will return the information you need, but you
> don't know how to manipulate a SQL-DMO QueryResults object? If so, then
> you need to iterate over it, and use the GetColumn% methods to return
> the data in the format you want - in this case, GetColumnString is
> probably the best one to use.
>
> This is a simple VBScript example of using a QueryResults object:
>
> Option Explicit
>
> Dim oSrv, res, c, r
>
> Set oSrv = WScript.CreateObject("SQLDMO.SqlServer2")
> oSrv.LoginSecure = True
> oSrv.Name = "MyServer"
> oSrv.Connect
>
> Set res = oSrv.ExecuteWithResults("select * from sysobjects")
>
> For r = 1 To res.Rows
> For c = 1 To res.Columns
> If res.ColumnName(c) = "name" Then
> WScript.Echo res.GetColumnString(r, c)
> End If
> Next
> Next
>
>
> If this isn't helpful, you might get a better answer in
> microsoft.public.sqlserver.replication.
>
> Simon
--
Your eyes are weary from staring at the CRT. You feel sleepy. Notice
how restful it is to watch the cursor blink. Close your eyes. The
opinions stated above are yours. When I snap my fingers, you cannot
imagine why you ever felt otherwise. <snap>
Navigation:
[Reply to this message]
|