달력

62025  이전 다음

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
반응형

<%

 

    'On Error Resume Next 구문은 에러가 발생해도 일단 에러부분을 무시하고 넘기게 됩니다.
    On Error Resume next
 
    Dim strConnect, dbCon, rs
    strConnect="DSN=test;uid=sa;pwd=1234;"

  
    SET dbCon=server.CreateObject("ADODB.Connection")
    dbCon.Open strConnect
 
    SET rs = dbCon.execute("select uid, name, addr from TestTable where uid ='"& uid &"'")

 

    'Error 발생했을때 처리하게 되는 루틴입니다.
    if Err.Number <> 0 then
    response.Write "<h2>DB연결에 실패하였습니다.</h2>"
    Err.Clear
    response.end
    else
    rs.Close
    Set rs = nothing
    dbCon.Close
    Set dbCon = nothing
    response.Write "<h2>DB연결에 성공하였습니다.</h2>"
    end if


%>

 

반응형
Posted by 친절한 웬디양~ㅎㅎ
|