StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



New Application Created - Error MessageExpand / Collapse
Author
Message
Posted 02/22/2007 7:49:55 AM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: Forum Members
Last Login: 04/11/2007 8:30:06 AM
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

Post #7107
Posted 02/22/2007 7:59:29 AM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: Forum Members
Last Login: 04/11/2007 8:30:06 AM
Posts: 99, Visits: 253
It seems if I delete the Administrator account I added through the Security Editor and use the "hardcoded" one supplied in AppMain.vb - all is well...strange!
Post #7108
Posted 02/22/2007 9:08:03 AM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: Forum Members
Last Login: 04/11/2007 8:30:06 AM
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)

Post #7112
Posted 02/22/2007 9:22:16 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 09/26/2008 8:30:36 AM
Posts: 2,685, Visits: 1,886
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


www.bungie.net
Post #7118
Posted 02/22/2007 10:26:29 AM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: 2 days ago @ 7:28:14 PM
Posts: 1,280, Visits: 3,259
Ben Kim (02/22/2007)
It is unfortunate that it does not support SQL 2000 (maybe this fact should be listed somewhere).


I know that in the near future, when RBS supports auditing, SQL 2000 is not supported, but I'm pretty sure it will work now (as I'm using it on SQL 2000). I just used the DDT to create the security tables and to deploy it. I'm using a separate security db from my app db, both on SQL 2000. The security db also include a number of custom tables I'm using for security. I haven't noticed any problems. Should I be noticing problems?

Also, when RBS is released with support for auditing, will the ONLY options be to use SQL 2005, even if auditing isn't used?

Post #7120
Posted 02/22/2007 11:59:26 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 09/26/2008 8:30:36 AM
Posts: 2,685, Visits: 1,886
Yes, the RBS as it stands now will work on SQL Server 2000.  However, we aren't saying that it's officially supported so we don't have to deal with all of the screams saying that the complete RBS (which will include auditing) doesn't support SQL Server 2000.  Right now it works, but the auditing won't support 2000.


www.bungie.net
Post #7122
Posted 02/22/2007 1:39:27 PM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: Forum Members
Last Login: 04/11/2007 8:30:06 AM
Posts: 99, Visits: 253
Greg,

Can you post the SQL 2000 scripts you have for the tables and views that support the security as is?

I would greatly appreciate it.

Ben

Post #7126
Posted 02/22/2007 3:03:28 PM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: 2 days ago @ 7:28:14 PM
Posts: 1,280, Visits: 3,259
Ben,

I used the DDT to create the tables (thus no script). I created a security database, because the DDT won't work with my app database (there are views/sprocs that aren't mine and the DDT would delete them ).

However, I just used SQL Server Management Studio to generate scripts for the SF tables and views. It these don't work, you might try creating you're own db with security (it is VERY easy with DDT) and see what is missing.

Good luck!



  Post Attachments 
SF_SecurityTableViewScripts_2K.zip (14 views, 3.90 KB)
Post #7128