I'm working on my first nHibernate project and piecing together some
details from a few tutorials. I believe I have most of the mapping
right, but it turns out that I can't get the Jet driver to work.
After following the instructions on this page:
http://www.thoughtproject.com/Snippets/NHibernateWithAccess/
I noticed that I was actually missing the Jet DLL.
I went to the trunk and built one, as well as tried the one from here:
http://coderead.wordpress.com/2010/10/20/nhibernate-jet-driver/
One of the comments on that page alludes to a solution involving the
config file. Can anyone help with this? My config file is pasted
below:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2" >
<!-- For simplicity, the NHibernate configuration is stored in this
file.
It must be named hibernate.cfg.xml and marked in Visual Studio to be
copied
to the output folder. -->
<session-factory>
<!-- By default NHibernate is aggressive in closing connections
between
SQL statments. This unfortunately causes a problem when reading
ID
numbers assigned by Access (e.g. in AutoNumber fields). See
comments
in the Test 1 section of Program.cs. -->
<!-- B<property name="hibernate.connection.release_mode">on_close</
property> -->
<property
name="connection.provider">NHibernate.Connection.DriverConnectionProvider</
property>
<property name="dialect">NHibernate.JetDriver.JetDialect,
NHibernate.JetDriver</property>
<property
name="connection.driver_class">NHibernate.JetDriver.JetDriver,
NHibernate.JetDriver</property>
<property name="show_sql">true</property>
<property name="proxyfactory.factory_class">
NHibernate.ByteCode.LinFu.ProxyFactoryFactory,
NHibernate.ByteCode.LinFu
</property>
<!-- The Sample.mdb file is located in the folder containing the
solution file. This is three folders upward. Relative paths
are supported in Jet connection strings. -->
<property
name="connection.connection_string">Provider=Microsoft.Jet.OLEDB.
4.0;Data Source=TieIns.mdb</property>
</session-factory>
</hibernate-configuration>