PRB: Error Occurs When You Submit a Profile if SAMACCOUNTNAME Is Not Set and the Profile Aggregates Between SQL Server and Active Directory (299723)



The information in this article applies to:

  • Microsoft Commerce Server 2000
  • Microsoft Commerce Server 2002

This article was previously published under Q299723

SYMPTOMS

When you call the createprofile method of the profileservice by using a site that aggregates a profile across Microsoft Active Directory and SQL Server, you may receive the following error message when the update is performed:
(-2147016657 0000207C: AtrErr: DSID-031905FA, #1: 0: 0000207C: DSID-031905FA, problem 1005 (CONSTRAINT_ATT_TYPE), data 0, Att 900dd (sAMAccountName).

CAUSE

The sAMAccoutName property is specific to Active Directory. This property is not automatically set by the profile system.

RESOLUTION

Change your code so that the sAMAccoutName property is set before you perform the update.

MORE INFORMATION

The following sample code is an example of how to resolve this problem in Visual Basic:
Private Sub Command1_Click()
username = Text1.Text
Dim appcfg As New appcfg<BR/>
Dim ps As New ProfileService
appcfg.Initialize ("supplierad")
Set optdict = appcfg.GetOptionsDictionary("")
Connstr = optdict.s_ProfileServiceConnectionString
ps.Initialize Connstr, "Profile Definitions"
Set Newprofile = ps.createprofile(username, "UserObject")
Newprofile.GeneralInfo.user_security_password = "Password"
Newprofile.GeneralInfo.User_Type = 1
Newprofile.ProfileSystem.sam_account_name = username
Newprofile.ProfileSystem.user_account_control = CLng(512)
Newprofile.Accountinfo.account_status = 1
Newprofile.Accountinfo.date_registered = Now()
Newprofile.BusinessDesk.partner_desk_role = 1
Newprofile.Update
Set Newprofile = Nothing
End Sub
				

Modification Type:MajorLast Reviewed:10/22/2003
Keywords:kberrmsg kbpending kbprb KB299723