Print Page | Close Window

Trouble setting user permissions in 7.9

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=11681
Printed Date: 11 April 2026 at 4:34pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Trouble setting user permissions in 7.9
Posted By: micke
Subject: Trouble setting user permissions in 7.9
Date 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




Replies:
Posted By: WebWiz-Bruce
Date 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


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: micke
Date 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.



Posted By: WebWiz-Bruce
Date 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.

-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: wasay
Date 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?


Posted By: wasay
Date 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 :)



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net