<%
''On Error Resume Next를 사용하여 에러처리를 가능하게 한다.
On Error Resume Next
Dim Dbconn
Set DbConn = Server.CreateObject("ADODB.Connection")
DbConn.Provider = "SQLOLEDB"
DbConn.ConnectionString = "SERVER=(서버명); Database=(DB명); UID=(ID);
PWD=(비빌번호)"
DbConn.Open
''에러가 나면 Secondry DB로 연결을 시도한다.
If Err.Number <> 0 Then
''관리자에게 메일로 통보
ufMailSend("Primary Server")
Err.Clear
DbConn. ConnectionString = "SERVER=(서버명); Database=(DB명); UID=(ID);
PWD=(비빌번호)"
DbConn.Open
End If
''Secondry DB의 연결도 실패할경우 에러 메시지를 출력한다.
''다른 서버가 더존재하면 Secondry 루틴을 다시 만든다.
If Err.Number <> 0 Then
''관리자에게 메일로 통보
ufMailSend("Secondry Server")
''에러 메시지 출력
Response.write "DB 서버 에러 발생"
Response.End
End If
''메일 보내기 Function
Function ufMailSend (Server_Name)
Dim objMail
SET objMail = Server.CreateObject("CDONTS.NewMail")
With objMail
.To = "ServerAdmin@Domain.com"
.From = "ServerAdmin@Domain.com"
.Subject = "DB 연결 에러발생"
.Body = "에러 발생 시간 : "& New &" <br> 에러 발생 서버 : "& Server_Name
.BodyFormat = 0 ''내용 형식(HTML : 0, Text : 1)
.MailFormat = 0 ''메일 형식(MIME : 0, Text : 1)
.Send
End With
Set objMail = Nothing
End Function
''On Error Goto 0 를 이용하여 에러 처리를 불가능하게 한다.
On Error Goto 0
%>
''On Error Resume Next를 사용하여 에러처리를 가능하게 한다.
On Error Resume Next
Dim Dbconn
Set DbConn = Server.CreateObject("ADODB.Connection")
DbConn.Provider = "SQLOLEDB"
DbConn.ConnectionString = "SERVER=(서버명); Database=(DB명); UID=(ID);
PWD=(비빌번호)"
DbConn.Open
''에러가 나면 Secondry DB로 연결을 시도한다.
If Err.Number <> 0 Then
''관리자에게 메일로 통보
ufMailSend("Primary Server")
Err.Clear
DbConn. ConnectionString = "SERVER=(서버명); Database=(DB명); UID=(ID);
PWD=(비빌번호)"
DbConn.Open
End If
''Secondry DB의 연결도 실패할경우 에러 메시지를 출력한다.
''다른 서버가 더존재하면 Secondry 루틴을 다시 만든다.
If Err.Number <> 0 Then
''관리자에게 메일로 통보
ufMailSend("Secondry Server")
''에러 메시지 출력
Response.write "DB 서버 에러 발생"
Response.End
End If
''메일 보내기 Function
Function ufMailSend (Server_Name)
Dim objMail
SET objMail = Server.CreateObject("CDONTS.NewMail")
With objMail
.To = "ServerAdmin@Domain.com"
.From = "ServerAdmin@Domain.com"
.Subject = "DB 연결 에러발생"
.Body = "에러 발생 시간 : "& New &" <br> 에러 발생 서버 : "& Server_Name
.BodyFormat = 0 ''내용 형식(HTML : 0, Text : 1)
.MailFormat = 0 ''메일 형식(MIME : 0, Text : 1)
.Send
End With
Set objMail = Nothing
End Function
''On Error Goto 0 를 이용하여 에러 처리를 불가능하게 한다.
On Error Goto 0
%>
[이 게시물은 관리자님에 의해 2011-10-31 16:46:12 기타에서 이동 됨]
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 130 | 20년 전 | 4014 | ||
| 129 | 20년 전 | 2952 | ||
| 128 | 20년 전 | 3693 | ||
| 127 | 20년 전 | 3533 | ||
| 126 | 20년 전 | 3784 | ||
| 125 | 20년 전 | 8605 | ||
| 124 | 20년 전 | 2607 | ||
| 123 | 20년 전 | 3760 | ||
| 122 | 20년 전 | 3219 | ||
| 121 | 20년 전 | 2620 | ||
| 120 | 20년 전 | 2680 | ||
| 119 | 20년 전 | 2595 | ||
| 118 | 20년 전 | 2868 | ||
| 117 |
|
20년 전 | 3071 | |
| 116 | 20년 전 | 5331 | ||
| 115 | 20년 전 | 3935 | ||
| 114 | 20년 전 | 4985 | ||
| 113 | 20년 전 | 6228 | ||
| 112 | 20년 전 | 7334 | ||
| 111 | 21년 전 | 18444 | ||
| 110 | 21년 전 | 6885 | ||
| 109 | 21년 전 | 2893 | ||
| 108 | 21년 전 | 4150 | ||
| 107 |
prosper
|
21년 전 | 2511 | |
| 106 |
prosper
|
21년 전 | 4329 | |
| 105 |
아우겐나이스
|
21년 전 | 2926 | |
| 104 | 21년 전 | 2273 | ||
| 103 | 21년 전 | 2486 | ||
| 102 | 21년 전 | 2272 | ||
| 101 | 21년 전 | 2588 | ||
| 100 | 21년 전 | 1765 | ||
| 99 | 21년 전 | 1580 | ||
| 98 | 21년 전 | 1627 | ||
| 97 | 21년 전 | 2144 | ||
| 96 | 21년 전 | 1894 | ||
| 95 | 21년 전 | 2391 | ||
| 94 | 21년 전 | 3575 | ||
| 93 | 21년 전 | 1574 | ||
| 92 | 21년 전 | 1768 | ||
| 91 | 21년 전 | 3191 | ||
| 90 | 21년 전 | 2350 | ||
| 89 | 21년 전 | 3187 | ||
| 88 | 21년 전 | 2877 | ||
| 87 | 21년 전 | 3304 | ||
| 86 | 21년 전 | 5150 | ||
| 85 | 21년 전 | 2534 | ||
| 84 | 21년 전 | 4835 | ||
| 83 | 21년 전 | 2516 | ||
| 82 | 21년 전 | 3130 | ||
| 81 | 21년 전 | 7642 | ||
| 80 | 21년 전 | 3840 | ||
| 79 | 21년 전 | 3222 | ||
| 78 | 21년 전 | 4703 | ||
| 77 | 21년 전 | 2912 | ||
| 76 | 21년 전 | 6230 | ||
| 75 | 21년 전 | 4480 | ||
| 74 | 21년 전 | 5796 | ||
| 73 | 21년 전 | 3636 | ||
| 72 | 21년 전 | 5978 | ||
| 71 | 21년 전 | 3130 | ||
| 70 | 21년 전 | 2859 | ||
| 69 | 21년 전 | 2649 | ||
| 68 | 21년 전 | 2457 | ||
| 67 | 21년 전 | 2663 | ||
| 66 | 21년 전 | 2684 | ||
| 65 | 21년 전 | 3794 | ||
| 64 | 21년 전 | 2837 | ||
| 63 | 21년 전 | 2466 | ||
| 62 | 21년 전 | 2276 | ||
| 61 | 21년 전 | 3094 | ||
| 60 | 21년 전 | 3142 | ||
| 59 | 21년 전 | 2528 | ||
| 58 | 21년 전 | 2600 | ||
| 57 | 21년 전 | 2984 | ||
| 56 | 21년 전 | 2344 | ||
| 55 | 21년 전 | 2773 | ||
| 54 | 21년 전 | 2142 | ||
| 53 | 21년 전 | 2372 | ||
| 52 | 21년 전 | 2713 | ||
| 51 |
prosper
|
21년 전 | 2363 | |
| 50 |
prosper
|
21년 전 | 2182 | |
| 49 | 21년 전 | 2195 | ||
| 48 | 21년 전 | 2355 | ||
| 47 | 21년 전 | 1949 | ||
| 46 | 21년 전 | 1936 | ||
| 45 | 21년 전 | 2140 | ||
| 44 | 21년 전 | 2375 | ||
| 43 | 21년 전 | 4589 | ||
| 42 |
prosper
|
21년 전 | 2720 | |
| 41 |
prosper
|
21년 전 | 2123 | |
| 40 | 21년 전 | 2188 | ||
| 39 | 21년 전 | 2159 | ||
| 38 | 21년 전 | 2434 | ||
| 37 | 21년 전 | 2578 | ||
| 36 | 21년 전 | 1786 | ||
| 35 | 21년 전 | 4088 | ||
| 34 | 21년 전 | 3861 | ||
| 33 | 21년 전 | 3001 | ||
| 32 |
prosper
|
21년 전 | 2914 | |
| 31 | 21년 전 | 5300 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기