THEO TODMAN’S WEBSITE CODE PAGES



This Page provides a jumping-off point for the VBA Code that generates my Website.

Table of Code Documentation Location 53 (2 items)

cmdWebsiteRegen_ClickAddCitations_List..

To access information, click on one of the links in the table above.

Go to top of page




Source Code of: AddCitations_List
Procedure Type: Public Function
Module: New Code
Lines of Code: 216
Go To End of This Procedure

Line-No. / Ref.Code Line
0001Public Function AddCitations_List(Object_Type, Object_ID, tsTextFile As TextStream, Optional DirectoryLevel, Optional Count_Only As Boolean)
0002Dim rsNotesLinks As Recordset
0003Dim strControlQuery As String
0004Dim rsTableControl2 As Recordset
0005Dim strLine As String
0006Dim x As Long
0007Dim Y As String
0008Dim z As Long
0009Dim strLink As String
0010Dim BackLevel As String
0011Dim strAbstractQuality As String
0012Dim strIcon As String
0013Dim strAlt As String
0014Dim strTitle As String
0015Dim Saved_Type As String
0016Dim Saved_ID As Integer
0017Dim Done As String
0018Dim i As Integer
0019Dim Cnt_Only As Boolean
0020 Dim Citations_Count As Integer
0021Dim NameRef As String
0022If IsMissing(Count_Only) Then
0023 Cnt_Only = False
0024Else
0025 Cnt_Only = Count_Only
0026End If
0027'This adds a list of citations for Notes (for which it was originally written - based on AddReadingList) and Authors
0028Select Case Object_Type
0029 Case "Note"
0030 strControlQuery = "SELECT * FROM Notes_Cited_By_All_List WHERE Notes_Cited_By_All_List.Note_ID = " & Object_ID & " ORDER BY Author, Title, Calling_NameRef;"
0031 Case "Author"
0032 strControlQuery = "SELECT * FROM Authors_Cited_By_All_List WHERE Authors_Cited_By_All_List.Author_ID = " & Object_ID & " ORDER BY Author, Title, Calling_NameRef;"
0033End Select
0034Set rsNotesLinks = CurrentDb.OpenRecordset(strControlQuery)
0035If Cnt_Only = True Then
0036 If rsNotesLinks.EOF Then
0037 Citations_Count = 0
0038 Else
0039 rsNotesLinks.MoveLast
0040 Citations_Count = rsNotesLinks.RecordCount
0041 End If
0042 AddCitations_List = Citations_Count
0043 Set rsNotesLinks = Nothing
0044 Exit Function
0045End If
0046If IsMissing(DirectoryLevel) Then
0047 BackLevel = "../../../"
0048Else
0049 BackLevel = "../../"
0050End If
0051If Not rsNotesLinks.EOF Then
0052 ' ... Header
0053 strControlQuery = "SELECT Website_Control.Line_Value FROM Website_Control WHERE (((Website_Control.Web_Page) = ""Note_Citation_List"") And ((Website_Control.Section) = ""Header"")) ORDER BY Website_Control.Line;"
0054 Set rsTableControl2 = CurrentDb.OpenRecordset(strControlQuery)
0055 rsTableControl2.MoveFirst
0056 Do While Not rsTableControl2.EOF
0057 strLine = rsTableControl2.Fields(0) & ""
0058 x = InStr(1, strLine, "**Heading**")
0059 If x > 0 Then
0060 Select Case Object_Type
0061 Case "Note"
0062 strLine = Replace(strLine, "**Heading**", "Authors, Books & Papers Citing this Note")
0063 Case "Author"
0064 strLine = Replace(strLine, "**Heading**", "Authors, Books, Papers & Notes Citing this Author")
0065 End Select
0066 End If
0067 tsTextFile.WriteLine strLine
0068 rsTableControl2.MoveNext
0069 Loop
0070 ' ... Rows .. Headings
0071 strControlQuery = "SELECT Website_Control.Line_Value FROM Website_Control WHERE (((Website_Control.Web_Page) = ""Note_Citation_List"") And ((Website_Control.Section) = ""Rows"")) ORDER BY Website_Control.Line;"
0072 Set rsTableControl2 = CurrentDb.OpenRecordset(strControlQuery)
0073 rsTableControl2.MoveFirst
0074 rsNotesLinks.MoveFirst
0075 Do While Not rsTableControl2.EOF
0076 strLine = rsTableControl2.Fields(0) & ""
0077 x = InStr(1, strLine, "**Column")
0078 If x > 0 Then
0079 z = Val(Mid(strLine, x + 8, 2))
0080 Y = "<B>" & rsNotesLinks.Fields(z - 1).Name & "</B>"
0081 If z = 4 Then
0082 Y = "Extra Links"
0083 End If
0084 Y = "<B>" & Y & "</B>"
0085 strLine = Left(strLine, x - 1) & Y & Mid(strLine, x + 12, Len(strLine))
0086 tsTextFile.WriteLine strLine
0087 End If
0088 rsTableControl2.MoveNext
0089 Loop
0090 'Rows
0091 rsTableControl2.MoveFirst
0092 Do While Not rsNotesLinks.EOF
0093 Do While Not rsTableControl2.EOF
0094 strLine = rsTableControl2.Fields(0) & ""
0095 x = InStr(1, strLine, "**Column")
0096 If x > 0 Then
0097 z = Val(Mid(strLine, x + 8, 2))
0098 Select Case z
0099 'Hyperlink
0100 Case 3
0101 Y = rsNotesLinks.Fields(z - 1).Value & ""
0102 NameRef = Left(Object_Type, 1) & Object_ID & "_" & rsNotesLinks.Fields(7).Value
0103 Select Case Y
0104 Case "Book"
0105 If rsNotesLinks.Fields(3).Value & "" = "" Then
0106 strLink = "BookSummaries/BookSummary_" & Mid(Trim(rsNotesLinks.Fields(6).Value + 100000), 2, 2) & "/BookPaperAbstracts/BookPaperAbstracts_" & rsNotesLinks.Fields(6).Value & ".htm"">"
0107 Else
0108 strAlt = rsNotesLinks.Fields(3).Value & ""
0109 strIcon = rsNotesLinks.Fields(4).Value & ""
0110 strTitle = rsNotesLinks.Fields(3).Value & ""
0111 strAbstractQuality = "<img src=""" & BackLevel & strIcon & """alt=""" & strAlt & " Abstract"" Title=""" & strTitle & """>"
0112 strLink = "BookSummaries/BookSummary_" & Mid(Trim(rsNotesLinks.Fields(6).Value + 100000), 2, 2) & "/BookPaperAbstracts/BookPaperAbstracts_" & rsNotesLinks.Fields(6).Value & ".htm#" & NameRef & """>"
0113 End If
0114 Case "Paper"
0115 If rsNotesLinks.Fields(3).Value & "" = "" Then
0116 strLink = "PaperSummaries/PaperSummary_" & Mid(Trim(rsNotesLinks.Fields(6).Value + 100000), 2, 2) & "/PaperSummary_" & rsNotesLinks.Fields(6).Value & ".htm"">"
0117 Else
0118 strAlt = rsNotesLinks.Fields(3).Value & ""
0119 strIcon = rsNotesLinks.Fields(4).Value & ""
0120 strTitle = rsNotesLinks.Fields(3).Value & ""
0121 strAbstractQuality = "<img src=""" & BackLevel & strIcon & """alt=""" & strAlt & " Abstract"" Title=""" & strTitle & """>"
0122 strLink = "Abstracts/Abstract_" & Mid(Trim(rsNotesLinks.Fields(6).Value + 100000), 2, 2) & "/Abstract_" & rsNotesLinks.Fields(6).Value & ".htm#" & NameRef & """>"
0123 End If
0124 Case "Author"
0125 strLink = "Authors/" & Left(Trim(rsNotesLinks.Fields(0).Value), 1) & "/Author_" & rsNotesLinks.Fields(0).Value & ".htm#" & NameRef & """>"
0126 Case "Note"
0127 If Val(rsNotesLinks.Fields(3).Value) = 10 Then
0128 strLink = "Secure_Jen/Notes_"
0129 Else
0130 strLink = "Notes/Notes_"
0131 End If
0132 strLink = strLink & Val(Mid(Trim(rsNotesLinks.Fields(6).Value + 100000), 3, 2)) & "/Notes_" & rsNotesLinks.Fields(6).Value & ".htm#" & NameRef & """>"
0133 End Select
0134 Y = "<A HREF=""" & BackLevel & strLink & Y & "</A> " & strAbstractQuality
0135 Case 4
0136 'Repeat citings
0137 Y = ""
0138 Saved_Type = rsNotesLinks.Fields(2).Value
0139 Saved_ID = rsNotesLinks.Fields(6).Value
0140 Done = "No"
0141 i = 1
0142 Do Until Done = "Yes"
0143 rsNotesLinks.MoveNext
0144 If rsNotesLinks.EOF Then
0145 rsNotesLinks.MovePrevious
0146 Done = "Yes"
0147 Else
0148 If (Saved_Type = rsNotesLinks.Fields(2).Value) And (Saved_ID = rsNotesLinks.Fields(6).Value) Then
0149 i = i + 1
0150 If Y <> "" Then
0151 Y = Y & ", "
0152 End If
0153 NameRef = Left(NameRef, InStr(NameRef, "_")) & rsNotesLinks.Fields(7).Value
0154 Select Case rsNotesLinks.Fields(2).Value
0155 Case "Book"
0156 If rsNotesLinks.Fields(3).Value & "" = "" Then
0157 strLink = "BookSummaries/BookSummary_" & Mid(Trim(rsNotesLinks.Fields(6).Value + 100000), 2, 2) & "/BookPaperAbstracts/BookPaperAbstracts_" & rsNotesLinks.Fields(6).Value & ".htm"">"
0158 Else
0159 strLink = "BookSummaries/BookSummary_" & Mid(Trim(rsNotesLinks.Fields(6).Value + 100000), 2, 2) & "/BookPaperAbstracts/BookPaperAbstracts_" & rsNotesLinks.Fields(6).Value & ".htm#" & NameRef & """>"
0160 End If
0161 Case "Paper"
0162 If rsNotesLinks.Fields(3).Value & "" = "" Then
0163 strLink = "PaperSummaries/PaperSummary_" & Mid(Trim(rsNotesLinks.Fields(6).Value + 100000), 2, 2) & "/PaperSummary_" & rsNotesLinks.Fields(6).Value & ".htm"">"
0164 Else
0165 strLink = "Abstracts/Abstract_" & Mid(Trim(rsNotesLinks.Fields(6).Value + 100000), 2, 2) & "/Abstract_" & rsNotesLinks.Fields(6).Value & ".htm#" & NameRef & """>"
0166 End If
0167 Case "Author"
0168 strLink = "Authors/" & Left(Trim(rsNotesLinks.Fields(0).Value), 1) & "/Author_" & rsNotesLinks.Fields(0).Value & ".htm#" & NameRef & """>"
0169 Case "Note"
0170 If Val(rsNotesLinks.Fields(3).Value) = 10 Then
0171 strLink = "Secure_Jen/Notes_"
0172 Else
0173 strLink = "Notes/Notes_"
0174 End If
0175 strLink = strLink & Val(Mid(Trim(rsNotesLinks.Fields(6).Value + 100000), 3, 2)) & "/Notes_" & rsNotesLinks.Fields(6).Value & ".htm#" & NameRef & """>"
0176 End Select
0177 Y = Y & "<A HREF=""" & BackLevel & strLink & i & "</A>"
0178 Else
0179 rsNotesLinks.MovePrevious
0180 Done = "Yes"
0181 End If
0182 End If
0183 Loop
0184 Case 6
0185 If rsNotesLinks.Fields(z - 1).Value = -1 Then
0186 Y = "Yes"
0187 Else
0188 Y = "&nbsp;"
0189 End If
0190 Case Else
0191 Y = rsNotesLinks.Fields(z - 1).Value & ""
0192 End Select
0193 If Y = "" Then
0194 Y = "&nbsp;"
0195 End If
0196 strLine = Left(strLine, x - 1) & Y & Mid(strLine, x + 12, Len(strLine))
0197 tsTextFile.WriteLine strLine
0198 Else
0199 tsTextFile.WriteLine strLine
0200 End If
0201 rsTableControl2.MoveNext
0202 Loop
0203 rsNotesLinks.MoveNext
0204 rsTableControl2.MoveFirst
0205 Loop
0206 ' ... Footer
0207 strControlQuery = "SELECT Website_Control.Line_Value FROM Website_Control WHERE (((Website_Control.Web_Page) = ""Note_Citation_List"") And ((Website_Control.Section) = ""Footer"")) ORDER BY Website_Control.Line;"
0208 Set rsTableControl2 = CurrentDb.OpenRecordset(strControlQuery)
0209 rsTableControl2.MoveFirst
0210 Do While Not rsTableControl2.EOF
0211 strLine = rsTableControl2.Fields(0) & ""
0212 tsTextFile.WriteLine strLine
0213 rsTableControl2.MoveNext
0214 Loop
0215End If
0216End Function

Procedures Calling This Procedure (AddCitations_List) Tables / Queries / Fragments Directly Used By This Procedure (AddCitations_List) Go To Start of This Procedure
Go To Top of This Page
Link to VBA Code Control Page



Source Code of: cmdWebsiteRegen_Click
Procedure Type: Private Sub
Module: Form_MainForm
Lines of Code: 591
Go To End of This Procedure

Line-No. / Ref.Code Line
0001Private Sub cmdWebsiteRegen_Click()
0002Dim strMessage As String
0003Dim StartTime As Double
0004Dim Full_StartTime As Double
0005Dim rsTableToRead As Recordset
0006Dim rsTableToRead2 As Recordset
0007Dim rsTableControl As Recordset
0008Dim Duration As Double
0009Dim Full_Duration As Double
0010Dim RunDate As Date
0011Dim strControlQuery As String
0012Dim Run_Type As String
0013Dim Start_Note_ID As Integer
0014Dim End_Note_ID As Integer
0015Dim Temp_Note_ID As Integer
0016Dim Note_Timestamp As Long
0017Dim Total_Run As Single
0018Dim Response As String
0019Dim Run_BookPaperControl As Boolean
0020Dim Run_Author_Letters As Boolean
0021Dim Run_Book_Summary_Ranges As Boolean
0022Dim Run_Paper_Summary_Ranges As Boolean
0023Dim Run_BookPaperLinks_Ranges As Boolean
0024Dim Run_BookPaperAbstract_Ranges As Boolean
0025Dim Run_Paper_Abstract_Ranges As Boolean
0026Dim Run_Note_Regen_Ranges As Boolean
0027Dim Run_Note_Archive_Regen_Ranges As Boolean
0028Dim Run_Note_Group_Concatenation As Boolean
0029 OK = Check_Database_Size()
0030Debug.Print Now() & " - Main Database size = " & Check_Database_Size & "Mb"
0031 strMessage = "Check that the Timesheet Spreadsheet is open ... and open it if not! Is it open?"
0032Response = MsgBox(strMessage, vbYesNo)
0033If Response = vbNo Then
0034 MsgBox ("Open the Timesheet Spreadsheet!")
0035 End
0036End If
0037strMessage = "Do you want to regenerate the Website?"
0038'Decide what to do ...
0039 DoCmd.RunSQL ("DELETE * FROM Website_Regen_Control;")
0040 strControlQuery = "INSERT INTO Website_Regen_Control ( Division, Last_Run, Regen_Mins, Title, Sequence, Link ) SELECT ""BookPaperControl"" AS Division, Min(BookPaperControl.Latest_Update) AS Last_Run, Sum(BookPaperControl.Time_To_Regenerate) AS Regen_Mins, ""BookPaperControl"" AS Title, 4 AS Sequence, ""BookPapers"" AS Link FROM BookPaperControl WHERE (((BookPaperControl.[Page Title]) <> ""Website-Generator Documentation (Bridge)"" And (BookPaperControl.[Page Title]) <> ""Website: Maintenance Dashboard"" And (BookPaperControl.[Page Title]) <> ""Books - Recent Purchases"")) GROUP BY ""BookPaperControl"", ""Book-Papers"", 4, ""BookPapers"";"
0041DoCmd.RunSQL (strControlQuery)
0042 strControlQuery = "INSERT INTO Website_Regen_Control ( Division, Last_Run, Regen_Mins, Title, Sequence, Link ) SELECT ""Author_Letters"" AS Division, Min(Author_Letters.Latest_Author_Letter_Update) AS Last_Run, Sum(Author_Letters.Time_To_Regenerate) AS Regen_Mins, ""Authors"" AS Title, 1 AS Sequence, ""Authors"" AS Link FROM Author_Letters GROUP BY ""Author_Letters"", ""Authors"", 1, ""Authors"";"
0043DoCmd.RunSQL (strControlQuery)
0044 strControlQuery = "INSERT INTO Website_Regen_Control ( Division, Last_Run, Regen_Mins, Title, Sequence, Link ) SELECT ""Book_Summary_Ranges"" AS Division, Min(Book_Summary_Ranges.Latest_Book_Range_Update) AS Last_Run, Sum(Book_Summary_Ranges.Time_To_Regenerate) AS Regen_Mins, ""Book Summaries"" AS Title, 2 AS Sequence, ""BookSummaries"" AS Link FROM Book_Summary_Ranges GROUP BY ""Book_Summary_Ranges"", ""Book Summaries"", 2, ""BookSummaries"";"
0045DoCmd.RunSQL (strControlQuery)
0046 strControlQuery = "INSERT INTO Website_Regen_Control ( Division, Last_Run, Regen_Mins, Title, Sequence, Link ) SELECT ""Paper_Summary_Ranges"" AS Division, Min(Paper_Summary_Ranges.Latest_Paper_Range_Update) AS Last_Run, Sum(Paper_Summary_Ranges.Time_To_Regenerate) AS Regen_Mins, ""Paper Summaries"" AS Title, 10 AS Sequence, ""PaperSummaries"" AS Link FROM Paper_Summary_Ranges GROUP BY ""Paper_Summary_Ranges"", ""Paper Summaries"", 10, ""PaperSummaries"";"
0047DoCmd.RunSQL (strControlQuery)
0048 strControlQuery = "INSERT INTO Website_Regen_Control ( Division, Last_Run, Regen_Mins, Title, Sequence, Link ) SELECT ""BookPaperLinks_Ranges"" AS Division, Min(BookPaperLinks_Ranges.Latest_Book_Range_Update) AS Last_Run, Sum(BookPaperLinks_Ranges.Time_To_Regenerate) AS Regen_Mins, ""Book-Paper Link Summaries"" AS Title, 5 AS Sequence, ""BookPaperLinkSummaries"" AS Link FROM BookPaperLinks_Ranges GROUP BY ""BookPaperLinks_Ranges"", ""Book-Paper Link Summaries"", 5, ""BookPaperLinkSummaries"";"
0049DoCmd.RunSQL (strControlQuery)
0050 strControlQuery = "INSERT INTO Website_Regen_Control ( Division, Last_Run, Regen_Mins, Title, Sequence, Link ) SELECT ""BookPaperAbstract_Ranges"" AS Division, Min(BookPaperAbstract_Ranges.Latest_Book_Range_Update) AS Last_Run, Sum(BookPaperAbstract_Ranges.Time_To_Regenerate) AS Regen_Mins, ""Book-Paper Abstracts"" AS Title, 3 AS Sequence, ""BookPaperAbstracts"" AS Link FROM BookPaperAbstract_Ranges GROUP BY ""BookPaperAbstract_Ranges"", ""Book-Paper Abstracts"", 3, ""BookPaperAbstracts"";"
0051DoCmd.RunSQL (strControlQuery)
0052 strControlQuery = "INSERT INTO Website_Regen_Control ( Division, Last_Run, Regen_Mins, Title, Sequence, Link ) SELECT ""Paper_Abstract_Ranges"" AS Division, Min(Paper_Abstract_Ranges.Latest_Paper_Range_Update) AS Last_Run, Sum(Paper_Abstract_Ranges.Time_To_Regenerate) AS Regen_Mins, ""Paper Abstracts"" AS Title, 9 AS Sequence, ""PaperAbstracts"" AS Link FROM Paper_Abstract_Ranges GROUP BY ""Paper_Abstract_Ranges"", ""Paper Abstracts"", 9, ""PaperAbstracts"";"
0053DoCmd.RunSQL (strControlQuery)
0054 strControlQuery = "INSERT INTO Website_Regen_Control ( Division, Last_Run, Regen_Mins, Title, Sequence, Link ) SELECT ""Note_Regen_Ranges"" AS Division, Min(Note_Regen_Ranges.Latest_Note_Range_Update) AS Last_Run, Sum(Note_Regen_Ranges.Time_To_Regenerate) AS Regen_Mins, ""Notes"" AS Title, 6 AS Sequence, ""Notes"" AS Link FROM Note_Regen_Ranges GROUP BY ""Note_Regen_Ranges"", ""Notes"", 6, ""Notes"";"
0055DoCmd.RunSQL (strControlQuery)
0056 strControlQuery = "INSERT INTO Website_Regen_Control ( Division, Last_Run, Regen_Mins, Title, Sequence, Link ) SELECT ""Note_Archive_Regen_Ranges"" AS Division, Min(Note_Archive_Regen_Ranges.Latest_Note_Range_Update) AS Last_Run, Sum(Note_Archive_Regen_Ranges.Time_To_Regenerate) AS Regen_Mins, ""Notes Archive"" AS Title, 8 AS Sequence, ""NotesArchive"" AS Link FROM Note_Archive_Regen_Ranges GROUP BY ""Note_Archive_Regen_Ranges"", ""Notes Archive"", 8, ""NotesArchive"";"
0057DoCmd.RunSQL (strControlQuery)
0058 strControlQuery = "INSERT INTO Website_Regen_Control ( Division, Last_Run, Regen_Mins, Title, Sequence, Link ) SELECT ""Note_Group_Concatenation"" AS Division, Min(Note_Groups.Latest_Concatenation) AS Last_Run, Sum(Note_Groups.Time_To_Concatenate) AS Regen_Mins, ""Concatenated Notes"" AS Title, 7 AS Sequence, ""ConcatenatedNotes"" AS Link FROM Note_Groups GROUP BY ""Note_Group_Concatenation"", ""Concatenated Notes"", 7, ""ConcatenatedNotes"";"
0059DoCmd.RunSQL (strControlQuery)
0060Response = vbNo
0061Do While Response = vbNo
0062 Total_Run = 0
0063 DoCmd.Close acTable, "Website_Regen_Control"
0064 DoCmd.OpenTable ("Website_Regen_Control")
0065 Set rsTableToRead = CurrentDb.OpenRecordset("SELECT Website_Regen_Control.* FROM Website_Regen_Control WHERE [Regen_Now?] = True ORDER BY Division;")
0066 If Not rsTableToRead.EOF Then
0067 rsTableToRead.MoveFirst
0068 strMessage = "Selected Function" & IIf(rsTableToRead.RecordCount > 1, "s", "") & ":-"
0069 Do While Not rsTableToRead.EOF
0070 strMessage = strMessage & Chr(10) & "... " & rsTableToRead.Fields(0) & ": " & Round(rsTableToRead.Fields(2) / 60, 1) & " hours (" & Round(rsTableToRead.Fields(1), 0) & ", " & Round((Now() - Round(rsTableToRead.Fields(1))), 0) & " days ago)"
0071 Total_Run = Total_Run + Nz(rsTableToRead.Fields(2))
0072 rsTableToRead.MoveNext
0073 Loop
0074 strMessage = strMessage & Chr(10) & Chr(10) & "Total Selected = " & Round(Total_Run / 60, 1) & " hours." & Chr(10) & Chr(10)
0075 Else
0076 MsgBox ("Nothing selected. Update the Website_Regen_Control Table.")
0077 End If
0078 Total_Run = 0
0079 Set rsTableToRead = CurrentDb.OpenRecordset("SELECT Website_Regen_Control.* FROM Website_Regen_Control WHERE [Regen_Now?] = False ORDER BY Division;")
0080 If Not rsTableToRead.EOF Then
0081 strMessage = strMessage & "Not selected:- " & Chr(10)
0082 rsTableToRead.MoveFirst
0083 Do While Not rsTableToRead.EOF
0084 strMessage = strMessage & "... " & rsTableToRead.Fields(0) & ": " & Round(rsTableToRead.Fields(2) / 60, 1) & " hours (" & Round(rsTableToRead.Fields(1), 0) & ", " & Round((Now() - Round(rsTableToRead.Fields(1))), 0) & " days ago)" & Chr(10)
0085 Total_Run = Total_Run + Nz(rsTableToRead.Fields(2))
0086 rsTableToRead.MoveNext
0087 Loop
0088 strMessage = strMessage & Chr(10) & "Total not Selected = " & Round(Total_Run / 60, 1) & " hours." & Chr(10) & Chr(10)
0089 End If
0090 strMessage = strMessage & " Proceed?"
0091 Response = MsgBox(strMessage, vbYesNoCancel)
0092 If Response = vbNo Then
0093 MsgBox ("Update the Website_Regen_Control Table.")
0094 Stop
0095 End If
0096Loop
0097If Response = vbCancel Then
0098 End
0099End If
0100 Set rsTableToRead = CurrentDb.OpenRecordset("SELECT Website_Regen_Control.Division, Website_Regen_Control.[Regen_Now?] FROM Website_Regen_Control WHERE (((Website_Regen_Control.Division)=""BookPaperControl""));")
0101Run_BookPaperControl = rsTableToRead.Fields(1)
0102 Set rsTableToRead = CurrentDb.OpenRecordset("SELECT Website_Regen_Control.Division, Website_Regen_Control.[Regen_Now?] FROM Website_Regen_Control WHERE (((Website_Regen_Control.Division)=""Author_Letters""));")
0103Run_Author_Letters = rsTableToRead.Fields(1)
0104 Set rsTableToRead = CurrentDb.OpenRecordset("SELECT Website_Regen_Control.Division, Website_Regen_Control.[Regen_Now?] FROM Website_Regen_Control WHERE (((Website_Regen_Control.Division)=""Book_Summary_Ranges""));")
0105Run_Book_Summary_Ranges = rsTableToRead.Fields(1)
0106 Set rsTableToRead = CurrentDb.OpenRecordset("SELECT Website_Regen_Control.Division, Website_Regen_Control.[Regen_Now?] FROM Website_Regen_Control WHERE (((Website_Regen_Control.Division)=""Paper_Summary_Ranges""));")
0107Run_Paper_Summary_Ranges = rsTableToRead.Fields(1)
0108 Set rsTableToRead = CurrentDb.OpenRecordset("SELECT Website_Regen_Control.Division, Website_Regen_Control.[Regen_Now?] FROM Website_Regen_Control WHERE (((Website_Regen_Control.Division)=""BookPaperLinks_Ranges""));")
0109Run_BookPaperLinks_Ranges = rsTableToRead.Fields(1)
0110 Set rsTableToRead = CurrentDb.OpenRecordset("SELECT Website_Regen_Control.Division, Website_Regen_Control.[Regen_Now?] FROM Website_Regen_Control WHERE (((Website_Regen_Control.Division)=""BookPaperAbstract_Ranges""));")
0111Run_BookPaperAbstract_Ranges = rsTableToRead.Fields(1)
0112 Set rsTableToRead = CurrentDb.OpenRecordset("SELECT Website_Regen_Control.Division, Website_Regen_Control.[Regen_Now?] FROM Website_Regen_Control WHERE (((Website_Regen_Control.Division)=""Paper_Abstract_Ranges""));")
0113Run_Paper_Abstract_Ranges = rsTableToRead.Fields(1)
0114 Set rsTableToRead = CurrentDb.OpenRecordset("SELECT Website_Regen_Control.Division, Website_Regen_Control.[Regen_Now?] FROM Website_Regen_Control WHERE (((Website_Regen_Control.Division)=""Note_Regen_Ranges""));")
0115Run_Note_Regen_Ranges = rsTableToRead.Fields(1)
0116 Set rsTableToRead = CurrentDb.OpenRecordset("SELECT Website_Regen_Control.Division, Website_Regen_Control.[Regen_Now?] FROM Website_Regen_Control WHERE (((Website_Regen_Control.Division)=""Note_Archive_Regen_Ranges""));")
0117Run_Note_Archive_Regen_Ranges = rsTableToRead.Fields(1)
0118 Set rsTableToRead = CurrentDb.OpenRecordset("SELECT Website_Regen_Control.Division, Website_Regen_Control.[Regen_Now?] FROM Website_Regen_Control WHERE (((Website_Regen_Control.Division)=""Note_Group_Concatenation""));")
0119Run_Note_Group_Concatenation = rsTableToRead.Fields(1)
0120Set rsTableToRead = Nothing
0121Full_Regen = True
0122'This process runs all the regeneration routines in sequence
0123Full_StartTime = Now()
0124RootCreated = ""
0125automatic_processing = "Yes"
0126Debug.Print Now() & " - Full Website Regen Started"
0127If Run_BookPaperControl = True Then
0128 Debug.Print Now() & " - BookPaperControl Regen Started"
0129 'Book Citings
0130 Set rsTableToRead = CurrentDb.OpenRecordset("SELECT * FROM BookPaperControl WHERE ID = ""WebpageGenBookCitations"";")
0131 StartTime = Now()
0132 WebpageGenBookCitings ("Yes")
0133 WebpageGenBookCitingsPage
0134 Duration = Round((Now() - StartTime) * 24 * 60, 1)
0135 rsTableToRead.Edit
0136 rsTableToRead.Fields(1) = Now()
0137 rsTableToRead.Fields(2) = Duration
0138 rsTableToRead.Update
0139 Set rsTableToRead = Nothing
0140 Debug.Print Now() & " - Book Citings Complete in " & Duration & " minutes."
0141 DoEvents
0142 'Books
0143 Set rsTableToRead = CurrentDb.OpenRecordset("SELECT * FROM BookPaperControl WHERE ID = ""WebpageGenBooks"";")
0144 StartTime = Now()
0145 WebpageGenBooks
0146 Duration = Round((Now() - StartTime) * 24 * 60, 1)
0147 rsTableToRead.Edit
0148 rsTableToRead.Fields(1) = Now()
0149 rsTableToRead.Fields(2) = Duration
0150 rsTableToRead.Update
0151 Set rsTableToRead = Nothing
0152 Debug.Print Now() & " - Books Complete in " & Duration & " minutes."
0153 DoEvents
0154 'Books - Location
0155 Set rsTableToRead = CurrentDb.OpenRecordset("SELECT * FROM BookPaperControl WHERE ID = ""WebpageGenBooksLocation"";")
0156 StartTime = Now()
0157 WebpageGenBooksLocation
0158 Duration = Round((Now() - StartTime) * 24 * 60, 1)
0159 rsTableToRead.Edit
0160 rsTableToRead.Fields(1) = Now()
0161 rsTableToRead.Fields(2) = Duration
0162 rsTableToRead.Update
0163 Set rsTableToRead = Nothing
0164 Debug.Print Now() & " - Books by Location Complete in " & Duration & " minutes."
0165 DoEvents
0166 'Books - Categorised
0167 Set rsTableToRead = CurrentDb.OpenRecordset("SELECT * FROM BookPaperControl WHERE ID = ""WebpageGenBooksCategorised"";")
0168 StartTime = Now()
0169 WebpageGenBooksCategorised
0170 Duration = Round((Now() - StartTime) * 24 * 60, 1)
0171 rsTableToRead.Edit
0172 rsTableToRead.Fields(1) = Now()
0173 rsTableToRead.Fields(2) = Duration
0174 rsTableToRead.Update
0175 Set rsTableToRead = Nothing
0176 Debug.Print Now() & " - Books Categorised Complete in " & Duration & " minutes."
0177 DoEvents
0178 'Books-to-Notes Link Pages
0179 Set rsTableToRead = CurrentDb.OpenRecordset("SELECT * FROM BookPaperControl WHERE ID = ""WebpageGenBooksToNotes"";")
0180 StartTime = Now()
0181 DoEvents
0182 'Note_Book_Links - Live Notes
0183 strControlQuery = "SELECT Notes.ID, Notes.Item_Text, 0 AS x FROM Notes;"
0184 Set rsTableToRead2 = CurrentDb.OpenRecordset(strControlQuery)
0185 OK = Regen_Note_Book_Links(rsTableToRead2, 0, 1, 2)
0186 DoEvents
0187 'Note_Book_Links - Archived Notes
0188 strControlQuery = "SELECT Notes_Archive.ID, Notes_Archive.Item_Text, Notes_Archive.[Timestamp] FROM Notes_Archive;"
0189 Set rsTableToRead2 = CurrentDb.OpenRecordset(strControlQuery)
0190 OK = Regen_Note_Book_Links(rsTableToRead2, 0, 1, 2)
0191 WebpageGenBooksToNotes
0192 WebpageGenNoteBooksLinks
0193 Duration = Round((Now() - StartTime) * 24 * 60, 1)
0194 rsTableToRead.Edit
0195 rsTableToRead.Fields(1) = Now()
0196 rsTableToRead.Fields(2) = Duration
0197 rsTableToRead.Update
0198 Set rsTableToRead = Nothing
0199 Set rsTableToRead2 = Nothing
0200 Debug.Print Now() & " - Note_Book_Links Complete in " & Duration & " minutes."
0201 DoEvents
0202 'Electronic Resources
0203 Set rsTableToRead = CurrentDb.OpenRecordset("SELECT * FROM BookPaperControl WHERE ID = ""WebpageGenElectronicResources"";")
0204 StartTime = Now()
0205 WebpageGenElectronicResources
0206 Duration = Round((Now() - StartTime) * 24 * 60, 1)
0207 rsTableToRead.Edit
0208 rsTableToRead.Fields(1) = Now()
0209 rsTableToRead.Fields(2) = Duration
0210 rsTableToRead.Update
0211 Set rsTableToRead = Nothing
0212 Debug.Print Now() & " - Electronic Resources Complete in " & Duration & " minutes."
0213 DoEvents
0214 'Paper Citings
0215 Set rsTableToRead = CurrentDb.OpenRecordset("SELECT * FROM BookPaperControl WHERE ID = ""WebpageGenPaperCitations"";")
0216 StartTime = Now()
0217 WebpageGenPaperCitings ("Yes")
0218 WebpageGenPaperCitingsPage
0219 Duration = Round((Now() - StartTime) * 24 * 60, 1)
0220 rsTableToRead.Edit
0221 rsTableToRead.Fields(1) = Now()
0222 rsTableToRead.Fields(2) = Duration
0223 rsTableToRead.Update
0224 Set rsTableToRead = Nothing
0225 Debug.Print Now() & " - Paper Citings Complete in " & Duration & " minutes."
0226 DoEvents
0227 'Papers
0228 Set rsTableToRead = CurrentDb.OpenRecordset("SELECT * FROM BookPaperControl WHERE ID = ""WebpageGenPhilosophyPapersFull"";")
0229 StartTime = Now()
0230 WebpageGenPhilosophyPapersFull
0231 Duration = Round((Now() - StartTime) * 24 * 60, 1)
0232 rsTableToRead.Edit
0233 rsTableToRead.Fields(1) = Now()
0234 rsTableToRead.Fields(2) = Duration
0235 rsTableToRead.Update
0236 Set rsTableToRead = Nothing
0237 Debug.Print Now() & " - Papers Complete in " & Duration & " minutes."
0238 DoEvents
0239 'Papers - Sub-Topic
0240 Set rsTableToRead = CurrentDb.OpenRecordset("SELECT * FROM BookPaperControl WHERE ID = ""WebpageGenPhilosophyPapersFullCategorisedSubTopic"";")
0241 StartTime = Now()
0242 WebpageGenPhilosophyPapersFullCategorisedSubTopic
0243 Duration = Round((Now() - StartTime) * 24 * 60, 1)
0244 rsTableToRead.Edit
0245 rsTableToRead.Fields(1) = Now()
0246 rsTableToRead.Fields(2) = Duration
0247 rsTableToRead.Update
0248 Set rsTableToRead = Nothing
0249 Debug.Print Now() & " - Papers by Sub-Topic Complete in " & Duration & " minutes."
0250 DoEvents
0251 'Papers - Categorised
0252 Set rsTableToRead = CurrentDb.OpenRecordset("SELECT * FROM BookPaperControl WHERE ID = ""WebpageGenPhilosophyPapersFullCategorised"";")
0253 StartTime = Now()
0254 WebpageGenPhilosophyPapersFullCategorised
0255 Duration = Round((Now() - StartTime) * 24 * 60, 1)
0256 rsTableToRead.Edit
0257 rsTableToRead.Fields(1) = Now()
0258 rsTableToRead.Fields(2) = Duration
0259 rsTableToRead.Update
0260 Set rsTableToRead = Nothing
0261 Debug.Print Now() & " - Papers Categorised Complete in " & Duration & " minutes."
0262 DoEvents
0263 'Identity Papers Read
0264 Set rsTableToRead = CurrentDb.OpenRecordset("SELECT * FROM BookPaperControl WHERE ID = ""WebpageGenIdentityPapersRead"";")
0265 StartTime = Now()
0266 WebpageGenIdentityPapersRead
0267 Duration = Round((Now() - StartTime) * 24 * 60, 1)
0268 rsTableToRead.Edit
0269 rsTableToRead.Fields(1) = Now()
0270 rsTableToRead.Fields(2) = Duration
0271 rsTableToRead.Update
0272 Set rsTableToRead = Nothing
0273 Debug.Print Now() & " - Identity Papers Read Complete in " & Duration & " minutes."
0274 DoEvents
0275 'Identity Papers Read - Sub-Topic
0276 Set rsTableToRead = CurrentDb.OpenRecordset("SELECT * FROM BookPaperControl WHERE ID = ""WebpageGenIdentityPapersReadSubTopics"";")
0277 StartTime = Now()
0278 WebpageGenIdentityPapersReadSubTopics
0279 Duration = Round((Now() - StartTime) * 24 * 60, 1)
0280 rsTableToRead.Edit
0281 rsTableToRead.Fields(1) = Now()
0282 rsTableToRead.Fields(2) = Duration
0283 rsTableToRead.Update
0284 Set rsTableToRead = Nothing
0285 Debug.Print Now() & " - Identity Papers Read by Sub-Topic Complete in " & Duration & " minutes."
0286 DoEvents
0287 'Identity Papers Full
0288 Set rsTableToRead = CurrentDb.OpenRecordset("SELECT * FROM BookPaperControl WHERE ID = ""WebpageGenIdentityPapersFull"";")
0289 StartTime = Now()
0290 WebpageGenIdentityPapersFull
0291 Duration = Round((Now() - StartTime) * 24 * 60, 1)
0292 rsTableToRead.Edit
0293 rsTableToRead.Fields(1) = Now()
0294 rsTableToRead.Fields(2) = Duration
0295 rsTableToRead.Update
0296 Set rsTableToRead = Nothing
0297 Debug.Print Now() & " - Identity Papers Full Complete in " & Duration & " minutes."
0298 DoEvents
0299 'Identity Papers Full - Sub-Topic
0300 Set rsTableToRead = CurrentDb.OpenRecordset("SELECT * FROM BookPaperControl WHERE ID = ""WebpageGenIdentityPapersFullSubtopic"";")
0301 StartTime = Now()
0302 WebpageGenIdentityPapersFullSubtopic
0303 Duration = Round((Now() - StartTime) * 24 * 60, 1)
0304 rsTableToRead.Edit
0305 rsTableToRead.Fields(1) = Now()
0306 rsTableToRead.Fields(2) = Duration
0307 rsTableToRead.Update
0308 Set rsTableToRead = Nothing
0309 Debug.Print Now() & " - Identity Papers Full - Sub-Topic Complete in " & Duration & " minutes."
0310 DoEvents
0311 'Note-Paper Links
0312 Set rsTableToRead = CurrentDb.OpenRecordset("SELECT * FROM BookPaperControl WHERE ID = ""WebpageGenPapersToNotes"";")
0313 StartTime = Now()
0314 DoEvents
0315 'Note_Paper_Links - Live Notes
0316 strControlQuery = "SELECT Notes.ID, Notes.Item_Text, 0 AS x FROM Notes;"
0317 Set rsTableToRead2 = CurrentDb.OpenRecordset(strControlQuery)
0318 OK = Regen_Note_Paper_Links(rsTableToRead2, 0, 1, 2)
0319 DoEvents
0320 'Note_Paper_Links - Archived Notes
0321 strControlQuery = "SELECT Notes_Archive.ID, Notes_Archive.Item_Text, Notes_Archive.[Timestamp] FROM Notes_Archive;"
0322 Set rsTableToRead2 = CurrentDb.OpenRecordset(strControlQuery)
0323 OK = Regen_Note_Paper_Links(rsTableToRead2, 0, 1, 2)
0324 WebpageGenPapersToNotes
0325 WebpageGenNotePapersLinks
0326 Duration = Round((Now() - StartTime) * 24 * 60, 1)
0327 rsTableToRead.Edit
0328 rsTableToRead.Fields(1) = Now()
0329 rsTableToRead.Fields(2) = Duration
0330 rsTableToRead.Update
0331 Set rsTableToRead = Nothing
0332 Set rsTableToRead2 = Nothing
0333 Debug.Print Now() & " - Note_Paper_Links Complete in " & Duration & " minutes."
0334 DoEvents
0335 'Precis by Sub-Topics
0336 Set rsTableToRead = CurrentDb.OpenRecordset("SELECT * FROM BookPaperControl WHERE ID = ""WebpageGenPrecisSubTopics"";")
0337 StartTime = Now()
0338 WebpageGenPrecisSubTopics
0339 Duration = Round((Now() - StartTime) * 24 * 60, 1)
0340 rsTableToRead.Edit
0341 rsTableToRead.Fields(1) = Now()
0342 rsTableToRead.Fields(2) = Duration
0343 rsTableToRead.Update
0344 Set rsTableToRead = Nothing
0345 Debug.Print Now() & " - Precis by Sub-Topics Complete in " & Duration & " minutes."
0346 DoEvents
0347 'WebRef Test Pages
0348 Set rsTableToRead = CurrentDb.OpenRecordset("SELECT * FROM BookPaperControl WHERE ID = ""WebRefs_Checker_Pages_Gen"";")
0349 StartTime = Now()
0350 WebRefs_Checker_Pages_Gen
0351 Duration = Round((Now() - StartTime) * 24 * 60, 1)
0352 rsTableToRead.Edit
0353 rsTableToRead.Fields(1) = Now()
0354 rsTableToRead.Fields(2) = Duration
0355 rsTableToRead.Update
0356 Set rsTableToRead = Nothing
0357 Debug.Print Now() & " - WebRef Test Pages Complete in " & Duration & " minutes."
0358 DoEvents
0359 'Note Links Pages
0360 Debug.Print Now() & " - Note Links Pages Regen Started"
0361 StartTime = Now()
0362 Auto_Reference_Notes_Regen ("Yes")
0363 Duration = Round((Now() - StartTime) * 24 * 60, 1)
0364 Debug.Print Now() & " - Note Links Pages Complete in " & Duration & " minutes."
0365 DoEvents
0366 'Documentation Generator
0367 Debug.Print Now() & " - Documentation Generator Regen Started"
0368 Set rsTableToRead = CurrentDb.OpenRecordset("SELECT * FROM BookPaperControl WHERE ID = ""Documentation_Generator"";")
0369 StartTime = Now()
0370 Documentation_Generator
0371 Duration = Round((Now() - StartTime) * 24 * 60, 1)
0372 rsTableToRead.Edit
0373 rsTableToRead.Fields(1) = Now()
0374 rsTableToRead.Fields(2) = Duration
0375 rsTableToRead.Update
0376 Set rsTableToRead = Nothing
0377 Debug.Print Now() & " - Documentation Generator Complete in " & Duration & " minutes."
0378 Debug.Print Now() & " - BookPaperControl Regen Completed"
0379End If
0380'Authors
0381If Run_Author_Letters = True Then
0382 Debug.Print Now() & " - Authors Regen Started"
0383 StartTime = Now()
0384 WebpageGenAuthorsSummary
0385 DoCmd.RunSQL ("UPDATE Author_Letters SET Author_Letters.[Select?] = True;")
0386 strDataQuery = "Authors_List_Letter"
0387 strControlTable = "Authors"
0388 strOutputFileShort = "Author"
0389 strOutputFolder = TheoWebsiteRoot & "\Authors\"
0390 strOutputFile = ""
0391 Run_Type = "Regen_Letters"
0392 CreateAuthorsWebPages (Run_Type)
0393 Duration = Round((Now() - StartTime) * 24 * 60, 1)
0394 Debug.Print Now() & " - Authors Complete in " & Duration & " minutes."
0395 DoEvents
0396End If
0397'Book Summaries
0398If Run_Book_Summary_Ranges = True Then
0399 Debug.Print Now() & " - Book Summaries Regen Started"
0400 StartTime = Now()
0401 DoCmd.RunSQL ("UPDATE Book_Summary_Ranges SET Book_Summary_Ranges.[Select?] = True;")
0402 CreateBookSummariesWebPages
0403 Duration = Round((Now() - StartTime) * 24 * 60, 1)
0404 Debug.Print Now() & " - Book Summaries Complete in " & Duration & " minutes."
0405 DoEvents
0406End If
0407'Paper Summaries
0408If Run_Paper_Summary_Ranges = True Then
0409 Debug.Print Now() & " - Paper Summaries Regen Started"
0410 StartTime = Now()
0411 DoCmd.RunSQL ("UPDATE Paper_Summary_Ranges SET Paper_Summary_Ranges.[Select?] = True;")
0412 CreatePaperSummariesWebPages
0413 Duration = Round((Now() - StartTime) * 24 * 60, 1)
0414 Debug.Print Now() & " - Paper Summaries Complete in " & Duration & " minutes."
0415 DoEvents
0416End If
0417'Book-Paper Links
0418If Run_BookPaperLinks_Ranges = True Then
0419 Debug.Print Now() & " - Book-Paper Links Regen Started"
0420 StartTime = Now()
0421 DoCmd.RunSQL ("UPDATE BookPaperLinks_Ranges SET BookPaperLinks_Ranges.[Select?] = True;")
0422 strControlTable = "Books_To_Papers"
0423 strOutputFileShort = "BooksToPapers"
0424 strOutputFolder = TheoWebsiteRoot & "\BookSummaries\"
0425 strOutputFile = ""
0426 strDataQuery = "Books_Versus_Papers_List"
0427 CreatePapersToBooksWebPages
0428 Duration = Round((Now() - StartTime) * 24 * 60, 1)
0429 Debug.Print Now() & " - Book-Paper Links Complete in " & Duration & " minutes."
0430 DoEvents
0431End If
0432'Book-Paper Abstracts
0433If Run_BookPaperAbstract_Ranges = True Then
0434 Debug.Print Now() & " - Book-Paper Abstracts Regen Started"
0435 StartTime = Now()
0436 DoCmd.RunSQL ("UPDATE BookPaperAbstract_Ranges SET BookPaperAbstract_Ranges.[Select?] = True;")
0437 automatic_processing = "Full"
0438 strControlTable = "BookPaperAbstracts"
0439 strOutputFileShort = "BookPaperAbstracts"
0440 strOutputFolder = TheoWebsiteRoot & "\BookSummaries\"
0441 strOutputFile = ""
0442 strDataQuery = "BookPaperAbstracts_List"
0443 CreateBookPaperAbstractsWebPages
0444 automatic_processing = "Yes"
0445 Duration = Round((Now() - StartTime) * 24 * 60, 1)
0446 Debug.Print Now() & " - Book-Paper Abstracts Complete in " & Duration & " minutes."
0447 DoEvents
0448End If
0449'Paper Abstracts
0450If Run_Paper_Abstract_Ranges = True Then
0451 Debug.Print Now() & " - Paper Abstracts Regen Started"
0452 StartTime = Now()
0453 DoCmd.RunSQL ("UPDATE Paper_Abstract_Ranges SET Paper_Abstract_Ranges.[Select?] = True;")
0454 CreateAbstractWebPages
0455 Duration = Round((Now() - StartTime) * 24 * 60, 1)
0456 Debug.Print Now() & " - Paper Abstracts Complete in " & Duration & " minutes."
0457 DoEvents
0458End If
0459'Notes
0460If Run_Note_Regen_Ranges = True Then
0461 Run_Type = ""
0462 Temp_Notes_Only = "No"
0463 Changed_Notes_Only = "No"
0464 Include_Associated_Notes = "No"
0465 Regen_Notes_Only = "Yes"
0466 Regenerate_the_Links = "Yes"
0467 Archive_Notes_Now = "No"
0468 DoCmd.RunSQL ("UPDATE Note_Regen_Ranges SET Note_Regen_Ranges.[Select?] = True;")
0469 Set rsTableToRead = CurrentDb.OpenRecordset("SELECT * FROM Note_Regen_Ranges WHERE [Select?] = True ORDER BY ID_Start;")
0470 Debug.Print Now() & " - Note Ranges Regen Started"
0471 DoEvents
0472 If Not rsTableToRead.EOF Then
0473 rsTableToRead.MoveFirst
0474 StartTime = Now()
0475 Do While Not rsTableToRead.EOF
0476 'Clear Notes_To_Regen table & ready for inserts
0477 DoCmd.RunSQL ("DELETE Notes_To_Regen.* FROM Notes_To_Regen;")
0478 Set rsTableControl = CurrentDb.OpenRecordset("SELECT Notes_To_Regen.* FROM Notes_To_Regen;")
0479 'Update the table
0480 Start_Note_ID = rsTableToRead.Fields(1)
0481 End_Note_ID = rsTableToRead.Fields(2)
0482 For Temp_Note_ID = Start_Note_ID To End_Note_ID
0483 rsTableControl.AddNew
0484 rsTableControl.Fields(0) = Temp_Note_ID
0485 rsTableControl.Update
0486 Next Temp_Note_ID
0487 automatic_processing = "Yes"
0488 CreateNotesWebPages
0489 Regenerate_the_Links = "no"
0490 'Update the control table
0491 Duration = Now() - StartTime
0492 Duration = Duration * 24 * 60
0493 Duration = Round(Duration, 1)
0494 RunDate = Now()
0495 rsTableToRead.Edit
0496 rsTableToRead.Fields(4) = RunDate
0497 rsTableToRead.Fields(5) = Duration
0498 rsTableToRead.Update
0499 StartTime = Now()
0500 rsTableToRead.MoveNext
0501 Debug.Print Now() & " - Note Ranges " & Start_Note_ID & "-" & End_Note_ID & " Complete in " & Duration & " minutes."
0502 DoEvents
0503 Loop
0504 End If
0505 Debug.Print Now() & " - Note Ranges Regen Completed"
0506 DoEvents
0507End If
0508'Notes Archive
0509If Run_Note_Archive_Regen_Ranges = True Then
0510 Debug.Print Now() & " - Note Archive Ranges Regen Started"
0511 DoCmd.RunSQL ("UPDATE Note_Archive_Regen_Ranges SET Note_Archive_Regen_Ranges.[Select?] = True;")
0512 Set rsTableToRead = CurrentDb.OpenRecordset("SELECT * FROM Note_Archive_Regen_Ranges WHERE [Select?] = True ORDER BY ID_Start;")
0513 If Not rsTableToRead.EOF Then
0514 rsTableToRead.MoveFirst
0515 Do While Not rsTableToRead.EOF
0516 StartTime = Now()
0517 Start_Note_ID = rsTableToRead.Fields(1)
0518 End_Note_ID = rsTableToRead.Fields(2)
0519 strControlQuery = "SELECT [ID], [Timestamp] FROM Notes_Archive WHERE [ID] >= " & Start_Note_ID & " AND [ID] <= " & End_Note_ID & " ORDER BY [ID], [Timestamp]; "
0520 Set rsTableControl = CurrentDb.OpenRecordset(strControlQuery)
0521 If Not rsTableControl.EOF Then
0522 rsTableControl.MoveFirst
0523 Do While Not rsTableControl.EOF
0524 Temp_Note_ID = rsTableControl.Fields(0)
0525 Note_Timestamp = rsTableControl.Fields(1)
0526 OK = OutputNotesWebPage_Archived(Temp_Note_ID, Note_Timestamp)
0527 rsTableControl.MoveNext
0528 Loop
0529 End If
0530 'Update the control table
0531 Duration = Now() - StartTime
0532 Duration = Duration * 24 * 60
0533 Duration = Round(Duration, 1)
0534 RunDate = Now()
0535 rsTableToRead.Edit
0536 rsTableToRead.Fields(4) = RunDate
0537 rsTableToRead.Fields(5) = Duration
0538 rsTableToRead.Update
0539 StartTime = Now()
0540 rsTableToRead.MoveNext
0541 Debug.Print Now() & " - Note Archive Ranges " & Start_Note_ID & "-" & End_Note_ID & " Complete in " & Duration & " minutes."
0542 DoEvents
0543 Loop
0544 End If
0545 Debug.Print Now() & " - Note Archive Ranges Regen Completed"
0546 DoEvents
0547End If
0548'Concatenated Note Groups
0549If Run_Note_Group_Concatenation = True Then
0550 Debug.Print Now() & " - Concatenated Note Groups Regen Started"
0551 Set rsTableControl = CurrentDb.OpenRecordset("SELECT Note_Groups.Note_Group, Note_Groups.ID FROM Note_Groups ORDER BY Note_Groups.Note_Group;")
0552 rsTableControl.MoveFirst
0553 StartTime = Now()
0554 Do Until rsTableControl.EOF
0555 strControlTable = "ConcatenatedNoteGroup"
0556 strOutputFolder = TheoWebsiteRoot & "\"
0557 strOutputFile = ""
0558 strDataQuery = "Notes_List_Group"
0559 Notes_Group_ID = rsTableControl.Fields(1)
0560 Notes_Group = rsTableControl.Fields(0)
0561 strOutputFileShort = Replace(Notes_Group, " ", "")
0562 strOutputFileShort = strOutputFileShort & "ConcatenatedNotes"
0563 DoCmd.RunSQL ("Delete * from Note_Group_Select;")
0564 Set rsTableToRead = CurrentDb.OpenRecordset("Select * from Note_Group_Select;")
0565 rsTableToRead.AddNew
0566 rsTableToRead.Fields(0) = Notes_Group_ID
0567 rsTableToRead.Update
0568 CreateConcatenatedNoteGroupWebPages
0569 rsTableControl.MoveNext
0570 Loop
0571 Duration = Round((Now() - StartTime) * 24 * 60, 1)
0572 Debug.Print Now() & " - Concatenated Note Groups Complete in " & Duration & " minutes."
0573 DoEvents
0574 Set rsTableControl = Nothing
0575 Set rsTableToRead = Nothing
0576End If
0577'Tidy Up - Output Dashboard
0578 Set rsTableToRead = CurrentDb.OpenRecordset("SELECT * FROM BookPaperControl WHERE ID = ""WebsiteMaintenanceDashboard"";")
0579StartTime = Now()
0580 Monthly_Report_Note1010_Update
0581Duration = Round((Now() - StartTime) * 24 * 60, 1)
0582rsTableToRead.Edit
0583rsTableToRead.Fields(1) = Now()
0584rsTableToRead.Fields(2) = Duration
0585rsTableToRead.Update
0586Set rsTableToRead = Nothing
0587Full_Regen = False
0588Full_Duration = Round((Now() - Full_StartTime) * 24, 1)
0589Debug.Print Now() & " - Full Website Regen Complete"
0590MsgBox Now() & " - Website Regeneration Complete in " & Full_Duration & " hours.", vbOKOnly, "Website Regeneration"
0591End Sub

Procedures Called By This Procedure (cmdWebsiteRegen_Click) Tables / Queries / Fragments Directly Used By This Procedure (cmdWebsiteRegen_Click) Go To Start of This Procedure
Go To Top of This Page
Link to VBA Code Control Page



© Theo Todman, June 2007 - July 2024. Please address any comments on this page to theo@theotodman.com. File output:
Website Maintenance Dashboard
Return to Top of this Page Return to Theo Todman's Philosophy Page Return to Theo Todman's Home Page