You can set (change) only read-write SQL-DMO properties.
To set a property, use the following syntax:
Object.Property = value
For example, to set a long property:
oSQLServer.LoginTimeout = 30
To set a string property:
oSQLServer.HostName = "Gizmo"
Note that you cannot set object properties; they are read-only.
For a property named Property, you use a function named SetProperty to set a property to a new value. Pass a program variable of the appropriate type to the SetProperty function. The SetProperty function will read the new value from the program variable and set the object property to that value. Use the following syntax:
pObject->SetProperty ( variable );
For example, to set a long property:
pSQLServer->SetLoginTimeout (30);
To set a string property:
pSQLServer->SetVersionString (TEXT("Gizmo"));
Note that you cannot set object properties; they are read-only.