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
Unable to Open database file (Salesforce)
Re: Unable to Open database file (Salesforce)
Please refer to http://forums.devart.com/viewtopic.php? ... 342#p82625. Does this help?
Re: Unable to Open database file (Salesforce)
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"];
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)
Please specify the full call stack of the error with all inner exceptions.
Re: Unable to Open database file (Salesforce)
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:
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)
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"/>
<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)
Thank you for your feedback.