<%'on error resume next%> Lineup2.asp <% dim conn, rs, sql, x, club, lineup, NextRecent, clubid dim catcher, first, sec, third, short, of1, of2, of3, backupof, p1, p2, p3, p4, backupp, extrap, dh 'position variables club = request.querystring("club") x = 0 set conn = server.createobject("adodb.connection") conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=\\brink-premfs1\sites\premium3\williamnewman\database\billnewman.mdb" 'Calls fields and values to insert into fields from previous page(lineup1.asp) clubid = request.querystring("clubid") catcher = request.querystring("catcher") first = request.querystring("first") sec = request.querystring("second") third = request.querystring("third") short = request.querystring("short") of1 = request.querystring("of1") of2 = request.querystring("of2") of3 = request.querystring("of3") backupof = request.querystring("backupof") p1 = request.querystring("p1") p2 = request.querystring("p2") p3 = request.querystring("p3") p4 = request.querystring("p4") backupp = request.querystring("backupp") extrap = request.querystring("extrap") dh = 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") %>