Date: Thu, 20 Feb 2003 15:37:01 +0900
From: "¤è¤·¤Þ¤ë" <who@sub.example.jp>
¤è¤·¤Þ¤ë¤Ç¤¹¡£
¥Í¥Ã¥È¥ï¡¼¥¯¥¨¥é¡¼¤Ë¤Ä¤¤¤ÆÄ´ºº¤ò¿Ê¤á¤¿¤Î¤Ç¤¹¤¬¡¢
¡¤ÎSELECTʸ¤ÏÀ®¸ù¤·¤Æ¤¤¤ë¤Î¤Ç¤¹¤¬¢¤ÎDELETEʸ¤Î
ȯ¹Ô»þ¤ËConnection¥¨¥é¡¼¤È¤Ê¤ê¤Þ¤¹¡£
¤³¤ì¤Ï¡¢°ìöÀܳ¤µ¤ì¤Æ¤¤¤ë¥³¥Í¥¯¥·¥ç¥ó¤¬ÅÓÃæ¤ÇÀÚÃǤµ¤ì
¤¿¤È»×¤¨¤ëÆ°¤¤Ç¤¹¡£
¤½¤ó¤Ê»ö¤¬¤¢¤ê¤¨¤ë¤Î¤Ç¤·¤ç¤¦¤«¡©
¤É¤Ê¤¿¤«¤ªÃηäò¼ø¤±¤Æ失¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡©
funcDBExecute¤ÎÃæ¤Ç¤ÏÁߤ¤Å¦¤à¤È°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡£
-----<¡¡funcDBExecute¤ÎÆâÍÆ¡¡START¡¡>-----
If (objCn_.State Or adStateOpen) = 0 Then ''¥³¥Í¥¯¥·¥ç¥ó¤¬Àܳ¤·¤Æ¤¤¤Ê¤¤
¾ì¹ç
''¤Ï¡¢¥¨¥é¡¼¤È¤¹¤ë¡£
Exit Function
End If
objCn_.Execute strSQL_, lngCount_, adCmdText ''£Ó£Ñ£Ì¤Î¼Â¹Ô
-----<¡¡funcDBExecute¤ÎÆâÍÆ¡¡¤³¤³¤Þ¤Ç¡¡>-----
-----<¡¡¾ã³²È¯À¸¤Î¥½¡¼¥¹¡¡START¡¡>-----
¡ strSQL(0) = "SELECT MAX(Æü»þ) FROM C¥Æ¡¼¥Ö¥ë (TABLOCK HOLDLOCK)"
blnRtn = funcDBExecute(mconChild, strSQL(0), lngCnt, True, blnDeadLock_)
Do While (blnRtn = True)
strSQL(0) = "DELETE FROM C¥Æ¡¼¥Ö¥ë" & _
" WHERE Æü»þ BETWEEN '" & strDttm & "0000' AND " & _
"'" & strDttm & "0559' "
strSQL(1) = "DELETE FROM C¥Æ¡¼¥Ö¥ë" & _
" WHERE Æü»þ BETWEEN '" & strDttm & "0600' AND " & _
"'" & strDttm & "1159' "
strSQL(2) = "DELETE FROM C¥Æ¡¼¥Ö¥ë" & _
" WHERE Æü»þ BETWEEN '" & strDttm & "1200' AND " & _
"'" & strDttm & "1759' "
strSQL(3) = "DELETE FROM C¥Æ¡¼¥Ö¥ë" & _
" WHERE Æü»þ BETWEEN '" & strDttm & "1800' AND " & _
"'" & strDttm & "2359' "
For intIdx = LBound(strSQL) To UBound(strSQL)
'' C¥Æ¡¼¥Ö¥ë¤òºï½ü¤¹¤ë
¢ blnRtn = funcDBExecute(mconChild, strSQL(intIdx), lngCnt, True,
blnDeadLock_)
If blnDeadLock_ Then '' ¥Ç¥Ã¥É¥í¥Ã¥¯È¯À¸
Call subDeadLockAlm(C_MSG_ºï½ü¥ê¥È¥é¥¤, "C¥Æ¡¼¥Ö¥ë", _
Me.Name, "funcScan01MDelete")
End If
If blnRtn = False Then
On Error Resume Next '' ¥¨¥é¡¼¤ò̵»ë¤¹¤ë
If mconChild.Errors.Count > 0 Then
¡á¡á¡á¡á¡á¤³¤³¤Ç¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤¬½ÐÎϤµ¤ì¤ë
Call subPutCommLogTime("vbpDatGetOnline.frmDatGetOnline.funcScan01MDelete "
& _
" Number=" & mconChild.Errors(0).Number & _
" Description =" & mconChild.Errors(0).Description)
End If
On Error GoTo skip '' ¥¨¥é¡¼¤ò¥È¥é¥Ã¥×¤¹¤ë
End If
'' ¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¥í¥°ÀÚ¤ê¼Î¤Æ½èÍý
Call subLogTruncateKyk(mconChild, objClass.KyokuNo)
If blnRtn = False Then Exit For ''
Next intIdx
If strDttm >= strDttmEnd_ Then Exit Do '' ºï½ü½ªÎ»Æü¤Þ¤Ç½ªÎ»
strDttm = Format$(DateAdd("d", 1, Mid$(strDttm, 1, C_LEN_YEAR) & "/"
& _
Mid$(strDttm, 5, C_LEN_MON) & "/"
& _
Mid$(strDttm, 7, C_LEN_DAY) & " "
& _
"00:00:00"), _
"YYYYMMDD")
Loop
funcScan01MDelete = blnRtn '' ½èÍý·ë²Ì
Exit Function
skip:
'' ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤¹
¤ë
Call ErrorMsgBoxOpen(App.EXEName, Me.Name, "funcScan01MDelete")
End Function
-----<¡¡¾ã³²È¯À¸¤Î¥½¡¼¥¹¡¡¤³¤³¤Þ¤Ç¡¡>-----
[MSDE/SQLServer¤Ë´Ø¤·¤Æ¡¢º£¡¢¤É¤ó¤Ê¤³¤È¤Ë¤ªº¤¤ê¤Ç¤¹¤«¡©] |
¤è¤í¤·¤±¤ì¤Ð¤ªº¤¤ê¤ÎÆâÍƤò¡¢ÅŻҥ᡼¥ë¤Ç¶µ¤¨¤Æ²¼¤µ¤¤¡£ |
¼ÁÌä¤òÅŻҥ᡼¥ë¤ÇºîÀ®¤¹¤ë
|
[¥¦¥£¥ó¥É¤òÊĤ¸¤ë][MSDE/SQLServer FAQ ][MSDE / MSDE2000 µ»½Ñ¥µ¥Ý¡¼¥È¾ðÊó°ìÍ÷]
|