swappe numre
Har stirret mig blind på den her:Sender det her: liste.asp?action=move&menuid=21&sortID=1&direction=1
Skal gøre det her:
if( Request( "action" ) = "move" ) then
intID = CInt( Request( "menuid" ) )
intSortID = CInt( Request( "sortID" ) )
intDirection = CInt( Request( "direction" ) )
Dim strGetSwapSQL : strGetSwapSQL = "SELECT MenuID FROM menu WHERE h_sortID = " & ( CInt( intSortID ) + intDirection )
Set objRS = objConn.Execute( strGetSwapSQL )
Dim intSwapID : intSwapID = objRS( "menuID" )
Dim strMoveUpSQL : strMoveUpSQL = "UPDATE menu SET h_sortID = ( sortID + " & intDirection & " ) WHERE menuID = " & intID
objConn.Execute( strMoveUpSQL )
Dim strMoveDownSQL : strMoveDownSQL = "UPDATE menu SET h_sortID = ( sortID - " & intDirection & " ) WHERE menuID = " & Cint(intSwapID)
objConn.Execute( strMoveDownSQL )
end if
i databasen er menuid (autonummerering) h_sortID (tal)
Jeg får en " [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1. " på den første UPDATE linie - og kan bare IKKE se hvad der er galt - nogen der kan hjælpe mig her? :-)