I converted BKeeney ActiveRecord to a the web project:
See: www.bkeeney.com/rbinto/activerecord
it works but I can not run this code:
[code]Private Function GetContext() As BKS_ActiveRecord.P.Context
if m_ctxDefault is nil then
m_ctxDefault = new BKS_ActiveRecord.P.Context
end if
#if RBVersion >= 2011.04
#if TargetWeb
if not Session.Available then
return m_ctxDefault
end if
dim lck as new BKS_ActiveRecord.P.ScopedLock(csCtx)
if m_dictContext=nil then
m_dictContext = new Dictionary
end if
if not m_dictContext.HasKey(Session.Identifier) then
m_dictContext.Value(Session.Identifier) = new BKS_ActiveRecord.P.Context
end if
return m_dictContext.Value(Session.Identifier)
#endif
#endif
return m_ctxDefault
End Function
[/code]
in Web Returns m_dictTypeDB with value Nil (gives error in GetTypeConstructor) instead of a Dictionary with BKS_ActiveRecord.REALSQLDatabaseAdapter with name m_db and value REALSQLDatabase refering to a file in specific folderitem (/Users/…/ActiveRecord/db.rsd)
If i exclude #if TargetWeb Works
[code]Private Function GetContext() As BKS_ActiveRecord.P.Context
if m_ctxDefault is nil then
m_ctxDefault = new BKS_ActiveRecord.P.Context
end if
return m_ctxDefault
End Function
[/code]
could please somebody help me?
Thanks Rob