Web Wiz - Green Windows Web Hosting - Celebrating 25 Years!

  New Posts New Posts RSS Feed - Trouble setting user permissions in 7.9
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Trouble setting user permissions in 7.9

 Post Reply Post Reply
Author
micke View Drop Down
Newbie
Newbie


Joined: 03 September 2004
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote micke Quote  Post ReplyReply Direct Link To This Post Topic: Trouble setting user permissions in 7.9
    Posted: 03 September 2004 at 7:36am

Hi !

When I edit a users rights in the admin part I get an error when I try to update it. Has anyone had the same ?

I'm running WWF 7.9 with IIS6 and W2K3 Server standard with SQL 2000 server.

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'Read'.

/forum/admin/create_user_permissions.asp, line 133

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: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 03 September 2004 at 10:38am
Could be a corrupted file, try reuploading files again.

If this does not help some SQL servers do not like the field name 'Read' as it is a reserved word, square brackets have been put around this to make SQL Server work correctly with this feild name, but some SQL Servers just refeuse to work. Your server maybe one of these.

Also as this particular update is done by ADO make sure the server is running the latest MDAC drivers from www.microsoft.com/data


Edited by -boRg-
Back to Top
micke View Drop Down
Newbie
Newbie


Joined: 03 September 2004
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote micke Quote  Post ReplyReply Direct Link To This Post Posted: 03 September 2004 at 12:30pm

It seems like my server was one of thoose who didn't like it

I did however fix it by replacing this update/adding of permissions into tblPermission by replacing it with stored procedures.

That meant some tampering with create_user_permissions.asp and edit_user_permissions.asp. Just needed to comment out some code and add a few lines.

If someone is interested I can upload the modified files and a SQL script to generate the stored procedures.

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: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 03 September 2004 at 12:36pm
I may change some of the field names for version 8 to try and avoid these types of errors.
Back to Top
wasay View Drop Down
Newbie
Newbie


Joined: 02 December 2004
Location: United States
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote wasay Quote  Post ReplyReply Direct Link To This Post Posted: 02 December 2004 at 8:58am

Can some one post a example or help me out here? I am running into the same problem...

We have MS SQL 2000 but the .Fields("Read") is causing the problem... I tried putting .Fields(["Read"]) and .Fields("[Read]") but both doesn't seem to work...
 
I don't want to create a storeprocedure out of every little thing so is their a better way to solve it or one that is already working?
Back to Top
wasay View Drop Down
Newbie
Newbie


Joined: 02 December 2004
Location: United States
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote wasay Quote  Post ReplyReply Direct Link To This Post Posted: 02 December 2004 at 10:30am
it's ok I just recoded every thing for this strSQL string
 
 
' Executes SQL string
Function Executex(ByVal sql)
 Response.Write("sql: " & sql & "<BR>")
 Dim cnn
 Set cnn = Server.CreateObject("ADODB.Connection")
 cnn.Open GetConnectionString
 Set Executex = cnn.Execute(sql)
 Set cnn = nothing
End Function
 
'change the CBool value to bit value of 0 or 1
Function ConvertToBitValue(ByVal strValue)
 Dim returnString
 If (Trim(strValue) = "True") Then
  returnString = 1
 Else
  returnString = 0
 End If
 ConvertToBitValue = returnString
End Function
 
 
  If rsCommon.EOF Then
   strSQL = " INSERT INTO  " & strDbTable & "Permissions" _
     & " ( " _
     &  "Group_ID, " _
     &  "Forum_ID, " _
     &  "[Read], " _
     &  "Post, " _
     &  "Reply_posts, " _
     &  "Edit_posts, " _
     &  "Delete_posts , " _
     &  "Priority_pos ts, " _
     &  "Poll_create, " _
     &  "Vote, " _
     &  "Attachments, " _
     &  "Image_upload , " _
     &  "Moderate " _
     & " ) " _
     & " Values " _
     & " ( " _
     &  intUserGroupI D & ", " _
     &  iaryForumID & ", " _
     &  ConvertToBitV alue(CBool(Request.Form("read"))) & ", " _
     &  ConvertToBitV alue(CBool(Request.Form("post"))) & ", " _
     &  ConvertToBitV alue(CBool(Request.Form("reply"))) & ", " _
     &  ConvertToBitV alue(CBool(Request.Form("edit"))) & ", " _
     &  ConvertToBitV alue(CBool(Request.Form("delete"))) & ", " _
     &  ConvertToBitV alue(CBool(Request.Form("priority"))) & ", " _
     &  ConvertToBitV alue(CBool(Request.Form("poll"))) & ", " _
     &  ConvertToBitV alue(CBool(Request.Form("vote"))) & ", " _
     &  ConvertToBitV alue(CBool(Request.Form("files"))) & ", " _
     &  ConvertToBitV alue(CBool(Request.Form("images"))) & ", " _
     &  ConvertToBitV alue(CBool(Request.Form("moderate"))) & " " _
     & " ) "
  Else  
   strSQL = " Update  " & strDbTable & "Permissions" _
     & " SET " _
     & "Group_ID = " & intUserGroupID & ", " _
     & "Forum_ID = "  & iaryForumID & ", " _
     & "[Read] = "  & ConvertToBitValue(CBool(Request.Form("read"))) & ", " _
     & "Post = "   & ConvertToBitValue(CBool(Request.Form("post"))) & ", " _
     & "Reply_posts = " & ConvertToBitValue(CBool(Request.Form("reply"))) & ", " _
     & "Edit_posts = " & ConvertToBitValue(CBool(Request.Form("edit"))) & ", " _
     & "Delete_posts = " & ConvertToBitValue(CBool(Request.Form("delete"))) & ", " _
     & "Priority_posts = " & ConvertToBitValue(CBool(Request.Form("priority"))) & ", " _
     & "Poll_create = " & ConvertToBitValue(CBool(Request.Form("poll"))) & ", " _
     & "Vote = "   & ConvertToBitValue(CBool(Request.Form("vote"))) & ", " _
     & "Attachments = " & ConvertToBitValue(CBool(Request.Form("files"))) & ", " _
     & "Image_upload = " & ConvertToBitValue(CBool(Request.Form("images"))) & ", " _
     & "Moderate = "  & ConvertToBitValue(CBool(Request.Form("moderate"))) & " " _
     & " WHERE " & strDbTable & "Permissions.Group_ID = " & intUserGroupID & " AND " & strDbTable & "Permissions.Forum_ID = " & iaryForumID
  End If
  
  Executex(strSQL)
 
 
worked for me :)
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 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 Notice

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 at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

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