<!--#include virtual = "/common/lib/dbcon.asp" -->
<!--#include virtual = "/common/lib/func.asp" -->

<!--#include file = "config.asp" -->

<%

eb_idx		= InputValue(request("eb_idx"))  ' --일련번호
eb_code		= InputValue(request("eb_code")) ' --정렬번호
move		= InputValue(request("move"))    ' --이동




if move = "up" then
	sql = "select eb_idx, eb_code from ebook where   eb_code < "&eb_code &" order by eb_code desc"
ElseIf move = "down" then
	sql = "select eb_idx, eb_code from ebook where eb_code > "&eb_code &" order by eb_code"
End If
Set Rs = Dbcon.Execute (sql)

If Not rs.eof Then

	v_rseb_idx  = trim(rs("eb_idx"))  ' -- 대체할 디비번호
	v_rseb_code = trim(rs("eb_code")) ' -- 대체할 값


	sql1 = "update ebook set eb_code = "&eb_code &" where eb_idx = "&v_rseb_idx
	sql2 = "update ebook set eb_code = "&v_rseb_code &" where eb_idx = "&eb_idx
	Dbcon.execute sql1
	Dbcon.execute sql2

End If
rs.close : Set rs = Nothing
Dbcon.close : Set Dbcon = nothing

ok_url = "list.asp"
Call loding ("0",ok_url)
%>