OpenDataBase always return DBS_LOCKED Error

Hi, I am currently using Sage 50 and here is my problem.

I get the connection to work, it returns the host and the port fine but whenever I call the OpenDataBase function, it will always return DBS_LOCKED Error.

Username and password are the right one. I don't know what to fix in my code to get pass this error.

Thank you.

  • 0
    Hi,

    Are you using one of the sample files from the SDK?

    If you can't get any of your own code or a modified sample in the SDK to work *at all*, try running the executable as supplied with the SDK. If you've overwritten the original executables, make a backup copy of the entire SDK folder, and remove / reinstall the SDK to get it back.

    The default username on the supplied universl.sai data is (lower-case) 'sysadmin', and the password is never more than 7 characters. When using the SDK *both* the username and password are case-sensitive.

    The company data can remain 'open' for several minutes after it is closed in the application, and may show as in use when switching between the Sage 50 Canadian application and your compiled application.

    The Sample Company data as delivered is not usually set up for multi-user, so you will have to set a password for 'sysadmin' and create additional usernames.

    Try opening a command prompt and running the executable from there. You may see additional error messages that are hidden by the IDE.

    C# is the most complete (the demonstrated features can be uncommented in the section at the end of the sample.cs file, the VB demonstrates only a few features, and the c++ is pretty sparse.

    I hope that helps, please post back!

    Randy