This code runs on my local RoR/Windows 7 (64-bit):
sql = ActiveRecord::Base.connection()
last_pk = sql.insert("insert into manual (name) values ('hello new value')")
puts 'last_pk=', last_pk
but always displays "0."
For various reasons I can't use ActiveRecord in this situation.
(Note: The above code runs fine on my shared host. Also Note: I had to replace mysql5\bin\libmySQL.dll with a different DLL per another answer on StackOverflow.com in order to get ANY database connection to work.)