Ciao a tutti, è possibile fare due MMColParam, perchè se uno dipendente ha già il badge, bisogna prendere il filtro della matricola e invece se uno che non ha mai avuto il badge, prende quello numero badge. Come funziona?
codice:<% if request.Form("matricola") <> "" then %> <% Dim utenti Dim utenti_numRows Set utenti = Server.CreateObject("ADODB.Recordset") utenti.ActiveConnection = MM_autentica_STRING utenti.Source = "SELECT * FROM dbo.utente WHERE Cogn = '" + Replace(utenti__MMColParam, "'", "''") + "'" utenti.CursorType = 0 utenti.CursorLocation = 2 utenti.LockType = 1 utenti.Open() utenti_numRows = 0 %> <% Dim esistente__MMColParam 'esistente__MMColParam = "1" If (Request.QueryString("matricola") <> "") Then esistente__MMColParam = Request.QueryString("matricola") End If %> <% Dim esistente Dim esistente_numRows Set esistente = Server.CreateObject("ADODB.Recordset") esistente.ActiveConnection = MM_autentica_STRING esistente.Source = "SELECT * FROM dbo.assegnatario WHERE matricola = '" + Replace(esistente__MMColParam, "'", "''") + "'" esistente.CursorType = 0 esistente.CursorLocation = 2 esistente.LockType = 1 esistente.Open() esistente_numRows = 0 %> <% else %> <% Dim badge__MMColParam 'badge__MMColParam = "1" If (Request.QueryString("num_badge") <> "") Then badge__MMColParam = Request.QueryString("num_badge") End If %> <% Dim badge Dim badge_numRows Set badge = Server.CreateObject("ADODB.Recordset") badge.ActiveConnection = MM_autentica_STRING badge.Source = "SELECT * FROM dbo.assegnatario WHERE num_badge = " + Replace(badge__MMColParam, "'", "''") + "" badge.CursorType = 0 badge.CursorLocation = 2 badge.LockType = 3 badge.Open() badge_numRows = 0 %> <%end if%> <% Dim utenti__MMColParam utenti__MMColParam = "1" If (Session("MM_Username") <> "") Then utenti__MMColParam = Session("MM_Username") End If %>

Rispondi quotando