Is there a way to use MS Access DB (MDB files) on Azure sites?

We usually use Microsoft.ACE.OLEDB.12.0 to read and write from MS Access databases. On a regular server, you can just install Office or AccessDatabaseEngine_x64.exe and it works great.

Now we want to migrate our application to Azure (preferably to Azure Websites, not WebRole or a full VM). But we obviously cannot install the access drivers. Is there another way to use Access on Azure? Perhaps a third party driver or something that can be run / installed with user privileges.

We looked at dotConnect, but as far as I understand it still needs OLE DB for this.

Switching to Azure SQL is not an option as Access is used as the "FileType" for the third party system we are using.

+3


source to share


1 answer


Specifically for a cloud service, you can do the following:

  • Create a cloud service that wraps your main project / site.
  • Include MDB in the project wrapped from (1). There are many ways to do this.
  • Include any executable files or scripts that you want to deploy. You can add them to your Visual Studio project and set their Compose Actions action to Content.
  • In the finalized project, include the WebRole.cs file and implement RoleEntryPoint, and in particular, implement the public override bool OnStart () . This will allow you to run scripts, move files on the filesystem, etc.


The best part about using WebRole.cs to run your init code is that when Azure restores your cloud service, the code will always work and return the machine to a known state.

0


source







All Articles