Page 1 of 1

Unable to Open database file (Salesforce)

Posted: Mon 04 Aug 2014 18:19
by rcardoso
I created a VS project to connect to SF. My development environment is in windows 7 (32 bit). It works fine but when i deploy it to a Web Server (2012 R2 - 64 bit) in IIS it fails. First it told me that it was missing the sqlite3.dll file. So I copied the dll (64 bit version) from my dev environment to the bin folder where Devart.Data and Devart.Data.Salesforce resides
in the web server. But now it says "Unable to Open database file"
.

Am I missing any other dlls?

Sample code:

csb.Host = host;
csb.UserId = hguser;
csb.Password = hgpassword;
csb.SecurityToken = hgtoken;

try
{
connection = new SalesforceConnection(csb.ToString());

connection.Open(); \\ It fails here

Re: Unable to Open database file (Salesforce)

Posted: Tue 05 Aug 2014 15:03
by Shalex

Re: Unable to Open database file (Salesforce)

Posted: Tue 05 Aug 2014 18:17
by rcardoso
I added these parameters to my local environment just to tested like you suggested. I added the path value in the config value. The folders have read/write permission but it did not work. Same error message.
I also assign the path value to the default folder for the corresponding databases in AppData of the current user and it did not work either

<add key="DataCache" value="C:\Websites\SalesforcetoEpicIntegration\"/>
<add key="MetadataCache" value="C:\Websites\SalesforcetoEpicIntegration\"/>

SalesforceConnectionStringBuilder csb = new SalesforceConnectionStringBuilder();

csb.DataCache = ConfigurationManager.AppSettings["DataCache"];
csb.MetadataCache = ConfigurationManager.AppSettings["MetadataCache"];

Re: Unable to Open database file (Salesforce)

Posted: Wed 06 Aug 2014 14:04
by Shalex
Please specify the full call stack of the error with all inner exceptions.

Re: Unable to Open database file (Salesforce)

Posted: Wed 06 Aug 2014 17:16
by rcardoso
Devart.Data.SQLite.z was unhandled by user code
HResult=14
Message=Unable to open the database file
Source=Devart.Data.Salesforce
ErrorCode=14
StackTrace:
at Devart.Data.Salesforce.j.a(HeaderOptions A_0)
at Devart.Data.Salesforce.j..ctor(aj A_0)
at Devart.Data.Salesforce.al.a(h A_0, Object A_1, DbConnectionBase A_2)
at Devart.Common.DbConnectionFactory.a(DbConnectionPool A_0, h A_1, DbConnectionBase A_2)
at Devart.Common.DbConnectionPoolGroup.a(DbConnectionPool A_0, DbConnectionBase A_1)
at Devart.Common.DbConnectionPool.a(DbConnectionBase A_0)
at Devart.Common.DbConnectionPool.GetObject(DbConnectionBase owningConnection)
at Devart.Common.DbConnectionFactory.b(DbConnectionBase A_0)
at Devart.Common.DbConnectionClosed.Open(DbConnectionBase outerConnection)
at Devart.Common.DbConnectionBase.Open()
at Devart.Data.Salesforce.SalesforceConnection.Open()
at SalesForceIntegrationEpic.Login.btnLogin_Click(Object sender, EventArgs e)
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
InnerException:

Re: Unable to Open database file (Salesforce)

Posted: Wed 06 Aug 2014 21:16
by rcardoso
I added the database name to the path. It seems to be working now.

<add key="DataCache" value="C:\Websites\SalesforcetoEpicIntegration\sample.db"/>
<add key="MetadataCache" value="C:\Websites\SalesforcetoEpicIntegration\sample_metadata.db"/>

Re: Unable to Open database file (Salesforce)

Posted: Thu 07 Aug 2014 05:25
by Shalex
Thank you for your feedback.