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

Posted on 2011-10-24
Last Modified: 2012-05-12

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!  :)

Question by:itfdrift

    Author Comment

    LastErr is -2 (not 0 as previously written), what does that tell me?
    Where can i find some references for these error-codes?

    Accepted Solution

    ... It was a license issue, problem solved

    Author Closing Comment

    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.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
    This is about my first experience with programming Arduino.
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now