title: Open a sage 300 AccPac DBLink Connection to a session
body: <p>I am trying to write c# code around opening a Sage 300 Connection using C#.   I am using the Acccpac.Advantage DLL.</p>
  
  <p>Here is my code</p>
  
  <pre><code>try
  {
      sage300Session.Init(sessionHandle, appID, programName, appVersion);
      sage300Session.Open(_user, _ppswd, _companyID, DateTime.Today, 0);
  
      // Open a database link.
      sage300DbLink = sage300Session.OpenDBLink(DBLinkType.Company, DBLinkFlags.ReadWrite);
  }
  </code></pre>
  
  <p>The issue I am having is, no matter what I put in the password, the call to .Open seems to succeed.  If I put an invalid user or companyID, I get errors as expected. (the connestion status seems to say open either way).</p>
  
  <p>My question is - what is happening with the password that is doesn't seem to be used and 2- when I am through with what I am doing, is there a way to correctly close the connection?   </p>
  
  <p>The Accpac.Advantage dll is v 2.0.50727 and I am connecting to Sage 300 2014 environment.</p>