• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 342
  • Last Modified:

AccountObject.Save() simply returnes false, how do i debug??

Hi

I'm making a small app for a Merak 10 server in C# .net, using the Merak API ("IceWarp Server COM")
This problem is pretty specific for this particular API, so the explanation below is written in the presumption that you (my potential savior) have some sort of experience with the Merak API.

I can change properties on accounts, and even delete them, and the .Save() Method works great

THE PROBLEM is when i create a new account, the .Save() Method returns false, but no Exception is cast and the "LastErr" field in the account-object is 0, so no help there either. Nothing is logged, basically I'm throwing rocks in the dark...

What am i not getting here?

I'm doing it like this:

if (!accountList.Contains(email))
{
AccountObject konto = domain.NewAccount(email);
if (konto != null)
{
bool res = konto.SetProperty("u_password", password);
res = res && konto.SetProperty("u_name", navn);
res = res && konto.SetProperty("u_alias", email);
res = res && konto.SetProperty("u_mailbox", email);
if (res)
res = res && domain.Save();

return res;

}
else return false;
}
else return false;

Open in new window


For reference, this works just fine:

AccountObject konto = domain.OpenAccount(emailID);
if (konto != null)
{
bool res = konto.Delete();
bool save = konto.Save();
return (res && save);
}
else return false;

Open in new window


Any help is much appreciated!  :)

/Julian
0
itfdrift
Asked:
itfdrift
  • 3
1 Solution
 
itfdriftAuthor Commented:
Update:
LastErr is -2 (not 0 as previously written), what does that tell me?
Where can i find some references for these error-codes?
0
 
itfdriftAuthor Commented:
... It was a license issue, problem solved
0
 
itfdriftAuthor Commented:
I scooped out some ErrorCode info from the API's delphi-code.
-2 suggests a license-issue, and it turned out to be just that. The code was working as it should.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now