'#############################################################
'PAGEテーブル検索
'返回参数:newPageArray
'#############################################################
Public Function selectPageTbl(ByVal strPagePath As String, ByRef newPageArray() As PageTblType) As Boolean
Dim w_Rs As RDO.rdoResultset
Dim strSql As String
On Error GoTo Err
selectPageTbl = False
strSql = ""
If InStr(strPagePath, "/") > 0 Then
strSql = "SELECT * FROM dbo.PAGE_TBL WHERE PAGE_PATH='" & strPagePath & "'"
ElseIf InStr(strPagePath, ".") > 0 Then
strSql = "SELECT * FROM dbo.PAGE_TBL WHERE PAGE_NAME='" & Left(strPagePath, strPagePath.Length - 4) & "' AND PAGE_TYPE='" & Right(strPagePath, 3) & "'"
End If
w_Rs = Cng.OpenResultset(strSql, RDO.ResultsetTypeConstants.rdOpenStatic)
If w_Rs.RowCount > 0 Then
Do While Not w_Rs.EOF
newPageArray(UBound(newPageArray)).PAGE_NO = Trim(w_Rs.rdoColumns(0).Value.ToString)
newPageArray(UBound(newPageArray)).PAGE_NAME = Trim(w_Rs.rdoColumns(1).Value.ToString)
newPageArray(UBound(newPageArray)).PAGE_PATH = Trim(w_Rs.rdoColumns(2).Value.ToString)
newPageArray(UBound(newPageArray)).PAGE_TYPE = Trim(w_Rs.rdoColumns(3).Value.ToString)
ReDim Preserve newPageArray(UBound(newPageArray) + 1)
w_Rs.MoveNext()
Loop
selectPageTbl = True
End If
w_Rs = Nothing
Exit Function
Err:
errlog = errlog & Now & " pagetblselectエラー." & vbCrLf
errlog = errlog & Now & " SQL:" & strSql
w_Rs = Nothing
End Function
'#############################################################
'KEKKA_TBLテーブル插入
'返回参数:没有
'#############################################################
Public Function insertKekka(ByVal newPageNo As String, ByVal newKekkaArray() As KihonTblType) As Boolean
Dim w_Rs As RDO.rdoResultset
Dim sqlstr As String
Dim wkSrc As String
Dim iCnt As Integer
Dim spacFlg As Integer
Dim ChangeClass As New ClsChange
insertKekka = False
On Error GoTo Err
sqlstr = ""
'JSP 追加必要
sqlstr = ChangeClass.JspAddSrc(newPageNo)
spacFlg = 0
For iCnt = 0 To UBound(newKekkaArray) - 1
If Trim(newKekkaArray(iCnt).LINE_SRC.Replace(Chr(9), Space(1))).Equals("") Then
spacFlg = spacFlg + 1
Else
spacFlg = 0
End If
If spacFlg <= 1 Then
wkSrc = Replace(newKekkaArray(iCnt).LINE_SRC, "'", "''")
sqlstr = sqlstr + "INSERT INTO KEKKA_TBL VALUES('" & newPageNo & "','" & CInt(newKekkaArray(iCnt).LINE_NO) & "','" & wkSrc & "','" & Now().ToString & "') " & vbCrLf
End If
Next
Cng.Execute(sqlstr, RDO.OptionConstants.rdExecDirect)
w_Rs = Nothing
ChangeClass.PgtToJsp(newPageNo)
insertKekka = True
Exit Function
Err:
errlog = errlog & Now & " kekkainsertエラー." & vbCrLf
errlog = errlog & Now & " SQL:" & sqlstr
w_Rs = Nothing
End Function