UserName Property

This property specifies the user name for the local database or store-and-forward event sink.

Syntax

ReplicationEventSinkConfig.UserName[=UserName]

Parameters

UserName

The name of the user.

Remarks

You must have Site Server Publishing administrator privileges on the server to get or set this property.

Example

The following example sets the local database user name to CrsAdmin and the password to Oxymoron.

Option Explicit 
On Error Resume Next

const CRS_ERROR_NO_MORE_ITEMS  = 0&80003B17

dim ReplServer
set ReplServer = CreateObject("CrsApi.ReplicationServer")
ReplServer.Initialize("")

dim Iterator
Iterator = 0
dim EvSink

do while True
  'Clear any error text
  Err.Clear
  'Get an event sink
  set EvSink = ReplServer.EnumEventSinks(Iterator)

  'Quit if empty object returned (no more instances)
  if IsEmpty(EvSink) then exit do

  'Quit if "No more items" error 
  dim ReplError
  ReplError = Err.Number
  if ReplError = CRS_ERROR_NO_MORE_ITEMS then exit do

  if EvSink.CLSID = "Crssink" then 
    EvSink.Username = "CrsAdmin"
    EvSink.Password = "Oxymoron"
  end if
Loop
'Release objects
set EvSink     = Nothing
set ReplServer = Nothing

See Also

Password, ReplicationServer.AddEventSink, ReplicationServer.EnumEventSinks


© 1997-1998 Microsoft Corporation. All rights reserved.