1. Don Olliver
  2. SnapObjects
  3. Tuesday, 13 August 2019 15:17 PM UTC

I am attempting to connect a test WebAPI project to SQL Server 2017 using ODBC. It works, but only when using a 64-bit driver. Otherwise, the app generates "The specified dsn contains an architecture mismatch between the driver and application". Any suggestions for connecting using a 32-bit driver?


Don Olliver

Epic-Premier Inc.

Accepted Answer
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 13 August 2019 22:05 PM UTC
  2. SnapObjects
  3. # Permalink

You will need to request a 32-bit only version of the SnapObjects framework from support or you need to deploy this to a 32-bit machine instead of 64-bit machine.  The framework on NuGet.org is compiled using "Any CPU" option, in which case if your underlying OS is 64-bit then the .NET framework will always run SnapObjects in 64-bit mode.  If SnapObjects is 64-bit mode then the bitness of your DB driver needs to match.

Another thing to keep in mind is when you deploy the C# Web API or assembly you created in PowerBuilder, you also need to compile that using 32-bit only option instead of "Any CPU" so that you can force your C# code to run in 32-bit mode on 64-bit Windows.


  1. Don Olliver
  2. Wednesday, 14 August 2019 17:55 PM UTC
Thank you Armeen.

  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 14 August 2019 21:07 PM UTC
Hi Don;

FWIW: I would stay with the 64bit SS driver. It makes more sense performance wise and will be a lot less headache in the long run to maintain as new releases & fixes are published to the SnapObject framework.

Food for thought.

Regards ... Chris
  1. Helpful
  1. Armeen Mazda @Appeon
  2. Wednesday, 14 August 2019 22:37 PM UTC
I do agree with Chris... for C# server-side apps (e.g. C# Web APIs) it makes sense to go with Any CPU compilation option rather than force the app to run 32-bit on a 64-bit Windows Server.
  1. Helpful
There are no comments made yet.
Logan Liu @Appeon Accepted Answer Pending Moderation
  1. Friday, 16 August 2019 00:04 AM UTC
  2. SnapObjects
  3. # 1

Hi Don,

For SQL Server please use SnapObjects.Data.SqlServer (SQL Server database provider) instead of SnapObjects.Data.ODBC. ODBC is only supported for SQL Anywhere.

If you must use ODBC in .NET, please let us know the reason so we can consider this in the product roadmap?


There are no comments made yet.
  • Page :
  • 1

There are no replies made for this question yet.
However, you are not allowed to reply to this question.