|
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 :)
|