반응형
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
- 드립 커피
- 템플릿
- NGUI
- KO
- xamarin
- xamarin.android
- Classic ASP
- 태그를 입력해 주세요.
- 프렌치프레스
- 함수
- 자마린
- 리베리카
- 여행
- xamarin.forms
- 로부스타
- KnockoutJS
- 커피역사
- Android
- ServerVariables
- 원두
- vbscript
- 커피블로그
- shared
- asp
- fso
- 커피풍미
- 커피
- Unity
- 제주도
- 아라비카
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