I'm using Dapper with Microsoft Access (not by choice I assure you) and I'm also using the Dapper.Contrib extensions to allow me to do connection.Insert(address)
. Unfortunately that's throwing an error 'Characters found after end of SQL statement.'
because, I'm assuming, the SQL dapper generates is doing the insert and then asking for SCOPE_IDENTITY
and Access doesn't like multiple SQL statements separated by a ;
.
Is there any way to tell Dapper not to try and return the identity value?
I've had a look at the source code for the Dapper.Contrib and it looks like I'm probably out of luck?
So as an update on this: I couldn't get Dapper.Contrib to work nicely with Access, so in the end I switched from Dapper to PetaPoco. That's been live on the production system for a while now and has behaved very well with Access.
One very useful aspect of PetaPoco is that rather than being a compiled DLL, you actually just add a single PetaPoco.cs file to your project, which makes debugging much easier.
Other micro-ORMs are available etc., but PetaPoco has been a good solution for use with Microsoft Access thus far.