1

I've been developing a ASP website that uses a database. It works offline when I'm testing it but as soon as I upload it to my fasthosts account I get the following error when trying to run it:

Exception Details: System.InvalidOperationException: The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.

The connection string is as follows:

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ 
ConnectionStrings:ThreadString %>" ProviderName="<%$     
ConnectionStrings:ThreadString.ProviderName %>" SelectCommand="SELECT * FROM [Thread] 
WHERE ([rank] &lt;= ?) ORDER BY [rank]">

web.config file:

<add name="ThreadString" connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data  
Source=|DataDirectory|\Database.accdb"  providerName="System.Data.OleDb" />

any ideas why this is happening? Thanks in advance

user3437235
  • 92
  • 3
  • 9

2 Answers2

3

Connection to an ACCDB file (Access 2007 format) requires the ACE.OLEDB.12.0 driver. This driver needs to be installed on the ISP machine.
(That's probably the reason they ask you a different plan)

However you could change the format of your file to be Access 2003 that use the Microsoft.Jet.OLEDB.4.0 and this driver doesn't need to be installed on the ISP machine.

This is a document on the Microsoft site that explain how to do it.
Save an Access 2010 database in an earlier file format

But there is another problem. This driver is 32 bit only, so your ISP should allow the 32bit driver to run in the hosting process of your site (if they use a 64 bit OS). How this is done depends on your ISP tools and interface and how much they let you personalize their services.

Usually on a local IIS server you follow these steps

  • Go to the IIS Manager
  • Right click on the DefaultAppPool (or your application pool)
  • Select Advanced Settings
  • Set "Enable 32-bit Applications" to True.
Steve
  • 213,761
  • 22
  • 232
  • 286
  • very informative, thank you. I changed the driver but now im getting a new error Exception Details: System.Data.OleDb.OleDbException: Unrecognized database format '[file location]'. I made the database in access 2010 – user3437235 Jun 13 '14 at 13:20
  • Did you change the format of your ACCDB file to MDB as explained in the link above?. Rename also the file to have an MDB extension (Access 2003) – Steve Jun 13 '14 at 13:21
  • 8 hours I spent on that error. THANK YOU SO MUCH! – user3437235 Jun 13 '14 at 13:28
  • I dont have enough points to upvote but I'll accept the answer. Thanks again! – user3437235 Jun 13 '14 at 13:44
0

Try the following steps

  1. Right click on application and select properties.
  2. Go to Build section.
  3. Select Platform target to Any CPU
  4. Save the application.

build and run.

Learner
  • 1,286
  • 6
  • 34
  • 57