반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
Tags
- 커피
- KnockoutJS
- xamarin.forms
- NGUI
- Android
- Classic ASP
- fso
- vbscript
- liberica
- 템플릿
- 함수
- 라이트 로스팅
- 자마린
- 태그를 입력해 주세요.
- 제주도
- xamarin.android
- 여행
- ServerVariables
- 원두
- Unity
- 프렌치프레스
- xamarin
- asp
- KO
- 드립 커피
- robusta
- shared
- 수마트라 원두
- 아라비카
- 미디엄 로스팅
Archives
- Today
- Total
개발人
ASP 에서 트랜젝션 처리 본문
반응형
방법 1
set dbCon = Server.CreateObject("Adodb.Connection") on Error resume next dbCon.BeginTrans strSql = " Insert Into [테이블1명] values("입력값") dbCon.Execute(strSql) errNum = errNum + dbCon.errors.Count strSql = " Insert into [테이블2명] values("입력값1") dbCon.Execute(strSql) errNum = errNum + dbCon.errors.Count strSql = " Insert into [테이블2명] values("입력값2") dbCon.Execute(strSql) errNum = errNum + dbCon.errors.Count If errNum = 0 Then dbCon.CommitTrans response.write "트랜젝션 성공" Else dbCon.RollbackTrans response.write "트랜젝션 실패" End if
방법 2
set dbCon = Server.CreateObject("Adodb.Connection") on Error resume next dbCon.BeginTrans strSql = " Insert Into [테이블1명] values("입력값") dbCon.Execute(strSql) strSql = " Insert into [테이블2명] values("입력값1") dbCon.Execute(strSql) strSql = " Insert into [테이블2명] values("입력값2") dbCon.Execute(strSql) If dbCon.errors.Count <> 0 Then dbCon.errors.Clear dbCon.RollbackTrans response.write "트랜젝션 실패" Else dbCon.errors.Clear dbCon.CommitTrans response.write "트랜젝션 성공" End if
주의 : "관리도구" - "서비스" 에 보면 Distributed Transaction Coordinator 항목이 동작하고 있어야함.
반응형
'Classic ASP' 카테고리의 다른 글
쿠키공유 (0) | 2014.08.07 |
---|---|
쌍따옴표 & 홑따옴표 치환 (0) | 2014.08.07 |
폴더 생성 및 이름 변경 (0) | 2014.08.06 |
엑셀파일 변환 (0) | 2014.08.05 |
캐시 처리 (0) | 2014.08.04 |
Comments