Avanceret sletning
Hej alleMin delete-sætning virker ikke, men vi insert-sætning gør.
Kan du udfra min insert-sætning finde fejlen i delete-sætningen?
strSQL = "DELETE " & strTablePrefix & "MODERATOR WHERE FORUM_ID IN (FORUM_FORUM INNER JOIN FORUM_CATEGORY ON FORUM_FORUM.CAT_ID = FORUM_CATEGORY.CAT_ID INNER JOIN FORUM_GROUPS ON FORUM_CATEGORY.CAT_ID = FORUM_GROUPS.GROUP_CATID WHERE FORUM_GROUPS.GROUP_ID = 4) AND MEMBER_ID = " & cLng(Request.Form("MEMBER_ID"))
my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
strSQL = "INSERT INTO " & strTablePrefix & "MODERATOR (FORUM_ID, MEMBER_ID) VALUES ((SELECT FORUM_FORUM.FORUM_ID FROM FORUM_FORUM INNER JOIN FORUM_CATEGORY ON FORUM_FORUM.CAT_ID = FORUM_CATEGORY.CAT_ID INNER JOIN FORUM_GROUPS ON FORUM_CATEGORY.CAT_ID = FORUM_GROUPS.GROUP_CATID WHERE FORUM_GROUPS.GROUP_ID = 4), " & cLng(Request.Form("MEMBER_ID")) & ")"
my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
Hvis du kan optimere koden, må du endelige ikke holde dig tilbage ,-)