묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
asp 디비 접속 소스인데 문제가 생기는데 어디가 문제인지 봐주세요.
2004.12.05 13:09
고수님들의 답변 좀 부탁드립니다.
소스에 무슨 문제가 있는지 서버의 메모리를 조금씩 증가시키다가 결국엔 메모리가 꽉차서 asp가 뻗어버립니다.
원인을 찾아봐도 저는 모르겠습니다.
소스에 문제가 있는거 같은데 머가 문제일까요?
<%
Response.Expires = 0
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
%>
<html>
<head></head>
<body>
<!--ver. 0410161800 -->
<br><br>
<%
sQuery = Request.QueryString("Query")
sUserID = Request.QueryString("UserID")
strcon = "Driver={MySQL ODBC 3.51 Driver};Server=******;Database=*******;uid=*********;pwd=**********"
set DbCon = Server.CreateObject("ADODB.Connection")
if IsObject(DbCon) = False then
Response.Write "FAIL_Connection"
else
DbCon.open strcon
end if
Response.Write "[[##"
select case sQuery
case "CS01"
sSql = "SELECT jumin, endday FROM zetyx_member_table WHERE user_id = '" & sUserID & "'"
Set RS = DbCon.Execute(sSql)
while not RS.eof
Response.Write RS(0) & ":" & RS(1)
RS.MoveNext
wend
RS.Close
set RS = nothing
case "CS02"
sUserPW = Request.QueryString("UserPW")
sSql = "SELECT msn, jumin, endday FROM zetyx_member_table "
sSql = sSql & "WHERE user_id = '" & sUserID & "' and password = '" & sUserPW & "'"
Set RS = DbCon.Execute(sSql)
while not RS.eof
Response.Write RS(0) & ":" & RS(1) & ":" & RS(2)
RS.MoveNext
wend
RS.Close
set RS = nothing
case "CS03"
sClientIP = Request.QueryString("ClientIP")
sSql = "SELECT clientno FROM memberclient WHERE user_id = '" & sUserID & "' and clientip = '" & sClientIP & "'"
Set RS = DbCon.Execute(sSql)
while not RS.eof
Response.Write RS(0)
RS.MoveNext
wend
RS.Close
set RS = nothing
case "CS04"
sClientIP = Request.QueryString("ClientIP")
sClientNO = Request.QueryString("ClientNO")
sSql = "SELECT clientno FROM memberclient WHERE user_id = '" & sUserID & "' and clientno = '" & sClientNO & "'"
Set RS = DbCon.Execute(sSql)
while not RS.eof
Response.Write RS(0)
RS.MoveNext
wend
RS.Close
set RS = nothing
case "CS05"
sType = Request.QueryString("Type")
sSql = "SELECT mode FROM proginf WHERE type = '" & sType & "'"
Set RS = DbCon.Execute(sSql)
while not RS.eof
Response.Write RS(0)
RS.MoveNext
wend
RS.Close
set RS = nothing
case "CI00"
sProgram = Request.QueryString("Program")
sFunction = Request.QueryString("Function")
sLine = Request.QueryString("Line")
sNumber = Request.QueryString("Number")
sText = Request.QueryString("Text")
sCreatedDate = Request.QueryString("CreatedDate")
sSql = "INSERT INTO progerr (clientid, program, function, line, number, text, createddate) VALUES "
sSql = sSql & "('" & sUserID & "', '" & sProgram & "', '" & sFunction & "', '" & sLine & "', "
sSql = sSql & "'" & sNumber & "', '" & sText & "', '" & sCreatedDate & "')"
DbCon.Execute(sSql)
case "CI01"
sClientNO = Request.QueryString("ClientNO")
sClientIP = Request.QueryString("ClientIP")
sBadWord = Request.QueryString("BadWord")
sBadSite = Request.QueryString("BadSite")
sSql = "INSERT INTO userbadsite (user_id, clientno, clientip, badword, badsite) VALUES "
sSql = sSql & "('" & sUserID & "', '" & sClientNO & "', '" & sClientIP & "', "
sSql = sSql & "'" & sBadWord & "', '" & sBadSite & "')"
DbCon.Execute(sSql)
case "CI02"
sClientNO = Request.QueryString("ClientNO")
sClientIP = Request.QueryString("ClientIP")
sSql = "INSERT INTO memberclient(user_id, clientno, clientip) VALUES "
sSql = sSql & "('" & sUserID & "', '" & sClientNO & "', '" & sClientIP & "')"
DbCon.Execute(sSql)
case "CU01"
sClientNO = Request.QueryString("ClientNO")
sBadSiteOpt = Request.QueryString("BadSiteOpt")
sSql = "UPDATE memberclient SET badsiteopt ='+ '+ '" & sBadSiteOpt & "' "
sSql = sSql & "WHERE user_id ='" & sUserID & "' and clientno = '" & sClientNO & "'"
DbCon.Execute(sSql)
case "CU02"
sClientNO = Request.QueryString("ClientNO")
sCdPatchOpt = Request.QueryString("CdPatchOpt")
sSql = "UPDATE memberclient SET cdpatchopt ='" & sCdPatchOpt & "' "
sSql = sSql & "WHERE user_id ='" & sUserID & "' and clientno = '" & sClientNO & "'"
DbCon.Execute(sSql)
case "CU03"
sClientNO = Request.QueryString("ClientNO")
sVersion = Request.QueryString("Version")
sSql = "UPDATE memberclient SET version ='" & sVersion & "' "
sSql = sSql & "WHERE user_id ='" & sUserID & "' and clientno = '" & sClientNO & "'"
DbCon.Execute(sSql)
case "CD01"
sClientNO = Request.QueryString("ClientNO")
sSql = "DELETE FROM memberclient WHERE user_id = '" & sUserID & "' and clientno = '" & sClientNO & "'"
DbCon.Execute(sSql)
case "MS01"
case "MI01"
case "MU01"
case "MD01"
end select
Response.Write "##]]"
DbCon.Close
set DbCon = nothing
%>
</body>
</html>
소스에 무슨 문제가 있는지 서버의 메모리를 조금씩 증가시키다가 결국엔 메모리가 꽉차서 asp가 뻗어버립니다.
원인을 찾아봐도 저는 모르겠습니다.
소스에 문제가 있는거 같은데 머가 문제일까요?
<%
Response.Expires = 0
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
%>
<html>
<head></head>
<body>
<!--ver. 0410161800 -->
<br><br>
<%
sQuery = Request.QueryString("Query")
sUserID = Request.QueryString("UserID")
strcon = "Driver={MySQL ODBC 3.51 Driver};Server=******;Database=*******;uid=*********;pwd=**********"
set DbCon = Server.CreateObject("ADODB.Connection")
if IsObject(DbCon) = False then
Response.Write "FAIL_Connection"
else
DbCon.open strcon
end if
Response.Write "[[##"
select case sQuery
case "CS01"
sSql = "SELECT jumin, endday FROM zetyx_member_table WHERE user_id = '" & sUserID & "'"
Set RS = DbCon.Execute(sSql)
while not RS.eof
Response.Write RS(0) & ":" & RS(1)
RS.MoveNext
wend
RS.Close
set RS = nothing
case "CS02"
sUserPW = Request.QueryString("UserPW")
sSql = "SELECT msn, jumin, endday FROM zetyx_member_table "
sSql = sSql & "WHERE user_id = '" & sUserID & "' and password = '" & sUserPW & "'"
Set RS = DbCon.Execute(sSql)
while not RS.eof
Response.Write RS(0) & ":" & RS(1) & ":" & RS(2)
RS.MoveNext
wend
RS.Close
set RS = nothing
case "CS03"
sClientIP = Request.QueryString("ClientIP")
sSql = "SELECT clientno FROM memberclient WHERE user_id = '" & sUserID & "' and clientip = '" & sClientIP & "'"
Set RS = DbCon.Execute(sSql)
while not RS.eof
Response.Write RS(0)
RS.MoveNext
wend
RS.Close
set RS = nothing
case "CS04"
sClientIP = Request.QueryString("ClientIP")
sClientNO = Request.QueryString("ClientNO")
sSql = "SELECT clientno FROM memberclient WHERE user_id = '" & sUserID & "' and clientno = '" & sClientNO & "'"
Set RS = DbCon.Execute(sSql)
while not RS.eof
Response.Write RS(0)
RS.MoveNext
wend
RS.Close
set RS = nothing
case "CS05"
sType = Request.QueryString("Type")
sSql = "SELECT mode FROM proginf WHERE type = '" & sType & "'"
Set RS = DbCon.Execute(sSql)
while not RS.eof
Response.Write RS(0)
RS.MoveNext
wend
RS.Close
set RS = nothing
case "CI00"
sProgram = Request.QueryString("Program")
sFunction = Request.QueryString("Function")
sLine = Request.QueryString("Line")
sNumber = Request.QueryString("Number")
sText = Request.QueryString("Text")
sCreatedDate = Request.QueryString("CreatedDate")
sSql = "INSERT INTO progerr (clientid, program, function, line, number, text, createddate) VALUES "
sSql = sSql & "('" & sUserID & "', '" & sProgram & "', '" & sFunction & "', '" & sLine & "', "
sSql = sSql & "'" & sNumber & "', '" & sText & "', '" & sCreatedDate & "')"
DbCon.Execute(sSql)
case "CI01"
sClientNO = Request.QueryString("ClientNO")
sClientIP = Request.QueryString("ClientIP")
sBadWord = Request.QueryString("BadWord")
sBadSite = Request.QueryString("BadSite")
sSql = "INSERT INTO userbadsite (user_id, clientno, clientip, badword, badsite) VALUES "
sSql = sSql & "('" & sUserID & "', '" & sClientNO & "', '" & sClientIP & "', "
sSql = sSql & "'" & sBadWord & "', '" & sBadSite & "')"
DbCon.Execute(sSql)
case "CI02"
sClientNO = Request.QueryString("ClientNO")
sClientIP = Request.QueryString("ClientIP")
sSql = "INSERT INTO memberclient(user_id, clientno, clientip) VALUES "
sSql = sSql & "('" & sUserID & "', '" & sClientNO & "', '" & sClientIP & "')"
DbCon.Execute(sSql)
case "CU01"
sClientNO = Request.QueryString("ClientNO")
sBadSiteOpt = Request.QueryString("BadSiteOpt")
sSql = "UPDATE memberclient SET badsiteopt ='+ '+ '" & sBadSiteOpt & "' "
sSql = sSql & "WHERE user_id ='" & sUserID & "' and clientno = '" & sClientNO & "'"
DbCon.Execute(sSql)
case "CU02"
sClientNO = Request.QueryString("ClientNO")
sCdPatchOpt = Request.QueryString("CdPatchOpt")
sSql = "UPDATE memberclient SET cdpatchopt ='" & sCdPatchOpt & "' "
sSql = sSql & "WHERE user_id ='" & sUserID & "' and clientno = '" & sClientNO & "'"
DbCon.Execute(sSql)
case "CU03"
sClientNO = Request.QueryString("ClientNO")
sVersion = Request.QueryString("Version")
sSql = "UPDATE memberclient SET version ='" & sVersion & "' "
sSql = sSql & "WHERE user_id ='" & sUserID & "' and clientno = '" & sClientNO & "'"
DbCon.Execute(sSql)
case "CD01"
sClientNO = Request.QueryString("ClientNO")
sSql = "DELETE FROM memberclient WHERE user_id = '" & sUserID & "' and clientno = '" & sClientNO & "'"
DbCon.Execute(sSql)
case "MS01"
case "MI01"
case "MU01"
case "MD01"
end select
Response.Write "##]]"
DbCon.Close
set DbCon = nothing
%>
</body>
</html>