Every time I try to add a group from admin_usergroups, I get the following error:
Microsoft JET Database Engine error '80040e14'
Syntax error in ORDER BY clause.
/admin_usergroups.asp, line 117
The group is added successfully, but the page gets stuck on this error.
The lines of code in question are:
Case "Add", "Modify" '## add or modify group
strAddOrModify = "Add Group"
strConfirm = Request.Form("submit")
If strConfirm = "Add Group" Then
my_Conn.execute("INSERT INTO " & strTablePrefix & "USERGROUPS (USERGROUP_NAME,USERGROUP_DESC) VALUES ('" & Request.Form("GroupName") & "', '" & Request.Form("GroupDesc") & "')")
set rsGroup = Server.CreateObject("ADODB.Recordset")
set rsGroup = my_conn.execute("SELECT USERGROUP_ID FROM " & strTablePrefix & "USERGROUPS ORDER BY USERGROUP_ID DESC LIMIT 0,1")
Groupid = rsGroup("USERGROUP_ID")
rsGroup.Close
set rsGroup = nothing
Response.Redirect("admin_usergroups.asp?mode=Modify&ID=" & GroupID)
End If