Unable to Open database file (Salesforce)

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Cloud Applications
Post Reply
rcardoso
Posts: 6
Joined: Thu 31 Jul 2014 23:49

Unable to Open database file (Salesforce)

Post by rcardoso » Mon 04 Aug 2014 18:19

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

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Unable to Open database file (Salesforce)

Post by Shalex » Tue 05 Aug 2014 15:03


rcardoso
Posts: 6
Joined: Thu 31 Jul 2014 23:49

Re: Unable to Open database file (Salesforce)

Post by rcardoso » Tue 05 Aug 2014 18:17

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"];

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Unable to Open database file (Salesforce)

Post by Shalex » Wed 06 Aug 2014 14:04

Please specify the full call stack of the error with all inner exceptions.

rcardoso
Posts: 6
Joined: Thu 31 Jul 2014 23:49

Re: Unable to Open database file (Salesforce)

Post by rcardoso » Wed 06 Aug 2014 17:16

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:

rcardoso
Posts: 6
Joined: Thu 31 Jul 2014 23:49

Re: Unable to Open database file (Salesforce)

Post by rcardoso » Wed 06 Aug 2014 21:16

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"/>

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Unable to Open database file (Salesforce)

Post by Shalex » Thu 07 Aug 2014 05:25

Thank you for your feedback.

Post Reply