strSql = "Insert into tbl_notice ("
strSql = strSql & " title"
strSql = strSql & ",content"
strSql = strSql & ",mem_seq"
strSql = strSql & ",html_flag"
strSql = strSql & ",reg_t"
strSql = strSql & ") Values ("
strSql = strSql & "?,"
strSql = strSql & "?,"
strSql = strSql & "?,"
strSql = strSql & "?,"
strSql = strSql & "getDate())"
'
set cmd=server.createObject("ADODB.Command")
with cmd
.ActiveConnection = Con '-- 여기서 db는 Ado.Connection임
.CommandText = strSql
.Parameters.Append .CreateParameter("@title", adVarChar, adParamInput, 300)
.Parameters.Append .CreateParameter("@content", adVarChar, adParamInput, 4000)
.Parameters.Append .CreateParameter("@mem_seq", adInteger, adParamInput, 4)
.Parameters.Append .CreateParameter("@html_flag", adVarChar, adParamInput, 1)
.Parameters("@title") = title
.Parameters("@content") = content
.Parameters("@mem_seq") = mem_seq
.Parameters("@html_flag") = html_flag
.execute
End with
set cmd=nothing
strSql = "Update tbl_notice Set"
strSql = strSql & " title = ? ,"
strSql = strSql & " content = ? ,"
strSql = strSql & " mem_seq = ? ,"
strSql = strSql & " html_flag = ?"
strSql = strSql & " Where board_seq = ? "
'
set cmd=server.createObject("ADODB.Command")
with cmd
.ActiveConnection = Con '-- 여기서 db는 Ado.Connection임
.CommandText = strSql
.Parameters.Append .CreateParameter("@title", adVarChar, adParamInput, 300)
.Parameters.Append .CreateParameter("@content", adVarChar, adParamInput, 4000)
.Parameters.Append .CreateParameter("@mem_seq", adInteger, adParamInput, 4)
.Parameters.Append .CreateParameter("@html_flag", adVarChar, adParamInput, 1)
.Parameters.Append .CreateParameter("@seq", adInteger, adParamInput, 4)
.Parameters("@title") = title
.Parameters("@content") = content
.Parameters("@mem_seq") = mem_seq
.Parameters("@html_flag") = html_flag
.Parameters("@seq") = pSeq
.execute
End with
set cmd=nothing
strSql = "delete from tbl_notice where board_seq = ?"
'
set cmd=server.createObject("ADODB.Command")
with cmd
.ActiveConnection = Con '-- 여기서 db는 Ado.Connection임
.CommandText = strSql
.Parameters.Append .CreateParameter("@seq", adInteger, adParamInput, 4)
.Parameters("@seq") = pSeq
.execute
End with
set cmd=nothing
'게시물 정보
strSql = "select seq" ' Rs(0) - 번호
strSql = strSql & ",quest_type" ' Rs(1) - 구분
strSql = strSql & ",question" ' Rs(2) - 질문
strSql = strSql & ",answer" ' Rs(3) - 답변
strSql = strSql & ",reg_t" ' Rs(4) - 작성일
strSql = strSql & " from tbl_faqboard"
strSql = strSql & " Where seq = ?"
'
set cmd=server.createObject("ADODB.Command")
with cmd
.ActiveConnection = Con '-- 여기서 db는 Ado.Connection임
.CommandText = strSql
.Parameters.Append .CreateParameter("@P1", adInteger, adParamInput, , pSeq)
set Rs = .execute
end with
set cmd=nothing
'
seq = Rs(0)
quest_type = Rs(1)
question = Rs(2)
answer = Rs(3)
reg_t = left(Rs(4) , 10)
'
Rs.Close
Set Rs = nothing
strSql = strSql & " title"
strSql = strSql & ",content"
strSql = strSql & ",mem_seq"
strSql = strSql & ",html_flag"
strSql = strSql & ",reg_t"
strSql = strSql & ") Values ("
strSql = strSql & "?,"
strSql = strSql & "?,"
strSql = strSql & "?,"
strSql = strSql & "?,"
strSql = strSql & "getDate())"
'
set cmd=server.createObject("ADODB.Command")
with cmd
.ActiveConnection = Con '-- 여기서 db는 Ado.Connection임
.CommandText = strSql
.Parameters.Append .CreateParameter("@title", adVarChar, adParamInput, 300)
.Parameters.Append .CreateParameter("@content", adVarChar, adParamInput, 4000)
.Parameters.Append .CreateParameter("@mem_seq", adInteger, adParamInput, 4)
.Parameters.Append .CreateParameter("@html_flag", adVarChar, adParamInput, 1)
.Parameters("@title") = title
.Parameters("@content") = content
.Parameters("@mem_seq") = mem_seq
.Parameters("@html_flag") = html_flag
.execute
End with
set cmd=nothing
strSql = "Update tbl_notice Set"
strSql = strSql & " title = ? ,"
strSql = strSql & " content = ? ,"
strSql = strSql & " mem_seq = ? ,"
strSql = strSql & " html_flag = ?"
strSql = strSql & " Where board_seq = ? "
'
set cmd=server.createObject("ADODB.Command")
with cmd
.ActiveConnection = Con '-- 여기서 db는 Ado.Connection임
.CommandText = strSql
.Parameters.Append .CreateParameter("@title", adVarChar, adParamInput, 300)
.Parameters.Append .CreateParameter("@content", adVarChar, adParamInput, 4000)
.Parameters.Append .CreateParameter("@mem_seq", adInteger, adParamInput, 4)
.Parameters.Append .CreateParameter("@html_flag", adVarChar, adParamInput, 1)
.Parameters.Append .CreateParameter("@seq", adInteger, adParamInput, 4)
.Parameters("@title") = title
.Parameters("@content") = content
.Parameters("@mem_seq") = mem_seq
.Parameters("@html_flag") = html_flag
.Parameters("@seq") = pSeq
.execute
End with
set cmd=nothing
strSql = "delete from tbl_notice where board_seq = ?"
'
set cmd=server.createObject("ADODB.Command")
with cmd
.ActiveConnection = Con '-- 여기서 db는 Ado.Connection임
.CommandText = strSql
.Parameters.Append .CreateParameter("@seq", adInteger, adParamInput, 4)
.Parameters("@seq") = pSeq
.execute
End with
set cmd=nothing
'게시물 정보
strSql = "select seq" ' Rs(0) - 번호
strSql = strSql & ",quest_type" ' Rs(1) - 구분
strSql = strSql & ",question" ' Rs(2) - 질문
strSql = strSql & ",answer" ' Rs(3) - 답변
strSql = strSql & ",reg_t" ' Rs(4) - 작성일
strSql = strSql & " from tbl_faqboard"
strSql = strSql & " Where seq = ?"
'
set cmd=server.createObject("ADODB.Command")
with cmd
.ActiveConnection = Con '-- 여기서 db는 Ado.Connection임
.CommandText = strSql
.Parameters.Append .CreateParameter("@P1", adInteger, adParamInput, , pSeq)
set Rs = .execute
end with
set cmd=nothing
'
seq = Rs(0)
quest_type = Rs(1)
question = Rs(2)
answer = Rs(3)
reg_t = left(Rs(4) , 10)
'
Rs.Close
Set Rs = nothing
'asp' 카테고리의 다른 글
ASP 페이지에서의 Stored Procedure 활용 (1) | 2007.05.02 |
---|---|
Command 객체를 이용한 트랜잭션 처리 (1) | 2007.05.02 |
Transaction controll (1) | 2007.05.02 |
CreateParameter 메서드 (ADO) (0) | 2007.05.02 |
html --> Excel 파일 출력 (0) | 2007.05.02 |