New Application Created - Error Message


Author
Message
Ben Kim
Ben Kim
StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)
Group: Forum Members
Posts: 99, Visits: 253
Hello,

I am creating a new application prototype and decided to try out your Role Based Security.  It is unfortunate that it does not support SQL 2000 (maybe this fact should be listed somewhere).  So after creating the tables in my database, I added an Administrator account using the Security Editor.  So far so good.  Next I started up my single form application which is based on the StrataFrame windows with security template and I receive the following error:

SqlException
 Invalid object name 'dbo.SFSUserRolePermissionInfo'.

Source     : .Net SqlClient Data Provider

Stack Trace:
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
   at MicroFour.StrataFrame.Data.DbDataSourceItem.GetDataTable(DbCommand Command, OnChangeEventHandler CallBack)
   at MicroFour.StrataFrame.Data.SqlDataSourceItem.GetDataTable(DbCommand Command, OnChangeEventHandler CallBack)
   at MicroFour.StrataFrame.Data.DataLayer.GetDataTable(DbCommand Command, Boolean RegisterNotification)
   at MicroFour.StrataFrame.Business.BusinessLayer.FillDataTable(DbCommand CommandToExecute)
   at MicroFour.StrataFrame.Security.BusinessObjects.SFSUserRolePermissionInfoBO.FillByUser(Int32 UserPK)
   at MicroFour.StrataFrame.Security.LoggedInUser.CreatePermissionsListRolesOnly(Int32 UserPK)
   at MicroFour.StrataFrame.Security.LoggedInUser.CreateNew(SFSUsersBO UserInfo)
   at MicroFour.StrataFrame.Security.Login.AttemptLogin(Object sender, EventArgs e)
   at MicroFour.StrataFrame.Security.LoginForm.OnAttemptLogin()
   at MicroFour.StrataFrame.Security.LoginForm.cmdOk_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.PerformClick()
   at System.Windows.Forms.Form.ProcessDialogKey(Keys keyData)
   at System.Windows.Forms.TextBoxBase.ProcessDialogKey(Keys keyData)
   at System.Windows.Forms.Control.PreProcessMessage(Message& msg)
   at System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg)
   at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg)

I do not see this table listed in any database nor in the creation script I downloaded from your site. 

Ideas?

Ben

Replies
Ben Kim
Ben Kim
StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)
Group: Forum Members
Posts: 99, Visits: 253
OK now that I have added a user (me) to the database, I am receiving this error once again.  What do I do now?  Here is it if you need it again:

SqlException
 Invalid object name 'dbo.SFSUserRolePermissionInfo'.

Source     : .Net SqlClient Data Provider

Stack Trace:
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
   at MicroFour.StrataFrame.Data.DbDataSourceItem.GetDataTable(DbCommand Command, OnChangeEventHandler CallBack)
   at MicroFour.StrataFrame.Data.SqlDataSourceItem.GetDataTable(DbCommand Command, OnChangeEventHandler CallBack)
   at MicroFour.StrataFrame.Data.DataLayer.GetDataTable(DbCommand Command, Boolean RegisterNotification)
   at MicroFour.StrataFrame.Business.BusinessLayer.FillDataTable(DbCommand CommandToExecute)
   at MicroFour.StrataFrame.Security.BusinessObjects.SFSUserRolePermissionInfoBO.FillByUser(Int32 UserPK)
   at MicroFour.StrataFrame.Security.LoggedInUser.CreatePermissionsListRolesOnly(Int32 UserPK)
   at MicroFour.StrataFrame.Security.LoggedInUser.CreateNew(SFSUsersBO UserInfo)
   at MicroFour.StrataFrame.Security.Login.AttemptLogin(Object sender, EventArgs e)
   at MicroFour.StrataFrame.Security.LoginForm.OnAttemptLogin()
   at MicroFour.StrataFrame.Security.LoginForm.cmdOk_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.PerformClick()
   at System.Windows.Forms.Form.ProcessDialogKey(Keys keyData)
   at System.Windows.Forms.TextBoxBase.ProcessDialogKey(Keys keyData)
   at System.Windows.Forms.Control.PreProcessMessage(Message& msg)
   at System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg)
   at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg)

StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Haha, you are perfectly correct... the database script from the help file does not include that view.  It's a view that joins several tables to create a flat list of the permissions associated with a user that were granted by a role.  So... here ya go:

CREATE VIEW [dbo].[SFSUserPermissionInfo]  AS
SELECT us_pk, pm_pk, pm_Key, up_Action, pm_BlockedMsgOrKey,
  pm_BlockedAction, ri_Action, ri_DaysOfWeek,
  ri_StartTime, ri_EndTime, ri_Workstation
 FROM SFSUsers
 INNER JOIN SFSUsersXPermissions ON us_pk = up_us_pk
 INNER JOIN SFSPermissions ON up_pm_pk = pm_pk
 LEFT JOIN SFSRestrictionItems ON up_Restriction = ri_rs_pk

CREATE VIEW [dbo].[SFSUserRolePermissionInfo]  AS
SELECT us_pk, rl_pk, rl_Role, pm_pk, pm_Key, rp_Action, pm_BlockedMsgOrKey,
  pm_BlockedAction, ri_Action, ri_DaysOfWeek,
  ri_StartTime, ri_EndTime, ri_Workstation
 FROM SFSUsers
 INNER JOIN SFSUsersXRoles ON us_pk = ur_us_pk
 INNER JOIN SFSRoles ON ur_rl_pk = rl_pk
 INNER JOIN SFSRolesXPermissions ON rl_pk = rp_rl_pk
 INNER JOIN SFSPermissions ON rp_pm_pk = pm_pk
 LEFT JOIN SFSRestrictionItems ON rp_Restriction = ri_rs_pk

I'll be sure to include those views in the script for the next update.  They're included in the DDT security package for deploying the security tables, but somehow, they got left out of the script, sorry Unsure

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search