Web Wiz - Solar Powered Eco Web Hosting

  New Posts New Posts RSS Feed - 'Group_ID' - Cannot insert the value NULL
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

'Group_ID' - Cannot insert the value NULL

 Post Reply Post Reply
Author
MortiOli View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 May 2002
Location: United Kingdom
Status: Offline
Points: 514
Post Options Post Options   Thanks (0) Thanks(0)   Quote MortiOli Quote  Post ReplyReply Direct Link To This Post Topic: 'Group_ID' - Cannot insert the value NULL
    Posted: 01 November 2006 at 9:08pm
I'm having problems adding a user permission in admin_user_permissions.asp and was hoping someone might be able to help...
 
After trying to update the permissions for someone, I receive the following error message;
 
Microsoft OLE DB Provider for SQL Server error '80040e2f'

Cannot insert the value NULL into column 'Group_ID', table 'databasename.dbo.tblPermissions'; column does not allow nulls. INSERT fails.

/forum/admin_user_permissions.asp, line 140

I'm using MS SQL, and when I try and edit the table (to enable NULLS) I receive the following error;
 
Error:   Incorrect syntax near the keyword 'Read'.
Source:   .Net SqlClient Data Provider
 
Has anyone ever received this error before, and if so, how do I fix it so I can update users permissions?
 
Many thanks in advance!
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9791
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 02 November 2006 at 9:32am
It sounds to me that you may have done some type of database migration from another database type like Access or you have moved the database from another server and not all the default values have been passed across to your present database.

The table tblPermissions the following fields need to NOT allow nulls and have the default value of 0

Group_ID
Author_ID
Forum_ID
Back to Top
MortiOli View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 May 2002
Location: United Kingdom
Status: Offline
Points: 514
Post Options Post Options   Thanks (0) Thanks(0)   Quote MortiOli Quote  Post ReplyReply Direct Link To This Post Posted: 02 November 2006 at 12:25pm
Yeah, back in the 7.x days, I migrated from Snitz, then further on, upgraded to 8.x
 
My tblPermissions currently looks like the below - does anything else need changing?
 
 
Name Data Type Size Nulls Default
Group_ID int 4 N  
Author_ID int 4 Y  
Forum_ID int 4 Y  
Read bit 1 Y (0)
Post bit 1 Y (0)
Reply_posts bit 1 Y (0)
Edit_posts bit 1 Y (0)
Delete_posts bit 1 Y (0)
Priority_posts bit 1 Y (0)
Poll_create bit 1 Y (0)
Vote bit 1 Y (0)
Attachments bit 1 Y (0)
Image_upload bit 1 Y (0)
Moderate bit 1 Y (0)
View_Forum bit 1 N (1)
Display_post bit 1 N (0)
Calendar_event bit 1 N (0)
 
 
From looking at the msSQL_server_setup.asp, I assume it's supposed to look like this;
 
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9791
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 02 November 2006 at 5:11pm
Yes the second one looks more correct, except you can delete the 'Read' field as that is no-longer used in version 8.
Back to Top
MortiOli View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 May 2002
Location: United Kingdom
Status: Offline
Points: 514
Post Options Post Options   Thanks (0) Thanks(0)   Quote MortiOli Quote  Post ReplyReply Direct Link To This Post Posted: 02 November 2006 at 6:46pm
Thanks Borg.
 
Any ideas on what this error means though, as it's what I receive when I try and remove the field in ASP.Net Enterprise Manager;
 
The object 'DF_tblPermissions_Read' is dependent on column 'Read'. ALTER TABLE DROP COLUMN Read failed because one or more objects access this column.
 
Thanks
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9791
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 02 November 2006 at 6:48pm
You should use something like Microsoft's SQL Management Studio to remotely administer SQL Server
Back to Top
MortiOli View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 May 2002
Location: United Kingdom
Status: Offline
Points: 514
Post Options Post Options   Thanks (0) Thanks(0)   Quote MortiOli Quote  Post ReplyReply Direct Link To This Post Posted: 02 November 2006 at 8:29pm
Thanks Borg - seems a great program, and free, suprisingly!
 
Managed to change all but one setting - currently logged with my host.
 
Cheers!
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.07
Copyright ©2001-2024 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Policy

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2024 Web Wiz Ltd. All rights reserved.