<%'on error resume next%> Lineup2.asp <% dim DB, RS, x, club, lineup, NextRecent club = request.querystring("club") x = 0 set DB = server.createobject("DBEdit.DBAccessProcs") DB.DSN="billnewman" 'Names data source DB.TableName="Lineups" 'Names table 'Calls fields and values to insert into fields from previous page DB.AddRecord "ClubID~ C~ 1B~ 2B~ 3B~ SS~ OF1~ OF2~ OF3~ BackupOF~ P1~ P2~ P3~ P4~ BackupP~ ExtraP~ DH", _ request.querystring("clubid") & "~ " _ & request.querystring("catcher") & "~ " & request.querystring("first") & "~ " _ & request.querystring("second") & "~ " & request.querystring("third") & "~ " _ & request.querystring("short") & "~ " & request.querystring("of1") & "~ " _ & request.querystring("of2") & "~ " & request.querystring("of3") & "~ " _ & request.querystring("backupof") & "~ " & request.querystring("p1") & "~ " _ & request.querystring("p2") & "~ " & request.querystring("p3") & "~ " _ & request.querystring("p4") & "~ " & request.querystring("backupp") & "~ " _ & request.querystring("extrap") & "~ " & request.querystring("dh") set DB2 = server.createobject("DBEdit.DBAccessProcs") DB2.DSN="billnewman" 'Names data source DB2.TableName="Lineups" 'Names table !just changed!! was clubs set RS2 = DB.GetRecords("no","no") if not(RS2.EOF) then Do Until RS2.EOF x = x + 1 'Counts total records RS2.MoveNext Loop end if set RS2 = nothing set DB = server.createobject("DBEdit.DBAccessProcs") DB.DSN="billnewman" 'Names data source DB.TableName="Lineups" 'Names table set RS = DB.GetRecord ("LineupID", x) 'Uses counter "x" to pick up last record response.write "
" response.write "" & club & "
" response.write "Lineup created: " & RS("Date") & "
" Response.Write "Catcher: " & RS("C") & "
" Response.Write "First Base: " & RS("1B") & "
" Response.Write "Second Base: " & RS("2B") & "
" Response.Write "Third Base: " & RS("3B") & "
" Response.Write "Shortstop: " & RS("SS") & "
" Response.Write "Designated Hitter: " & RS("DH") & "
" Response.Write "Outfielders: " & RS("OF1") & ", " & RS("OF2") & ", " & RS("OF3") & "
" Response.Write "Pitchers: " & RS("P1") & ", " & RS("P2") & ", " & RS("P3") & ", " & RS("P4") & "
" Response.Write "Backups: " & RS("BackupOF") & ", " & RS("BackupP") & ", " & RS("ExtraP") & "
" response.write "

" session("lineup") = RS("LineupID") 'Keeps session variable up with the change lineup = RS("LineupID") 'Copy to variable to transfer to club MostRecent dim DB5, RS5 set DB5 = server.createobject("DBEdit.DBAccessProcs") DB5.DSN="billnewman" 'Names data source DB5.TableName="Clubs" 'Names table !just changed!! was clubs set RS5 = DB5.GetRecord ("ClubID", request.querystring("clubid")) NextRecent = RS5("MostRecent") 'Picks up previous MostRecent before change, will copy to NextRecent set RS5 = nothing set DB5 = nothing dim conn3, rs3, sql3 set conn3 = server.createobject("adodb.connection") sql3 = "update Clubs set MostRecent='" & lineup & "' where ClubID =" & request.querystring("clubid") 'Updates most recent lineup in Clubs conn3.open "billnewman" conn3.execute sql3 conn3.close set conn3 = nothing dim conn4, rs4, sql4 set conn4 = server.createobject("adodb.connection") sql4 = "update Clubs set NextRecent='" & NextRecent & "' where ClubID =" & request.querystring("clubid") 'Updates previous most recent lineup in Clubs conn4.open "billnewman" conn4.execute sql4 conn4.close set conn4 = nothing 'response.write "Session variable lineup is now: " & session("lineup") %>