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