Visualizzazione dei risultati da 1 a 4 su 4
  1. #1
    Utente di HTML.it
    Registrato dal
    Jan 2007
    Messaggi
    395

    campi tabella da pieni a null

    buonasera a tutti.
    ho un form in cui inserisco alcuni dati in una tabella.
    ho un'altra pagina dove posso modificarli ma....

    esempio:
    inserisco un collegamento ipertestuale.
    poi modifico in campo cancellando il collegamento.

    pensavo fosse realmente cancellato invece
    nella pagina dove visualizzo tutti i campi della tabella mi esce comunque il "link" al collegamento dove però invece del collegamento al file appare (pasandoci sopra col mouse) la cartella.

    andando a cancellare il collegamento direttamente dalla tabella access il "link" sparisce.

    credo quindi che dovrei fare l'update e quando cancello il campo del collegamento dovrei impostarlo a null.

    ma come fare?

    grazie!!

  2. #2
    fa' vedere come fai adesso

  3. #3
    Utente di HTML.it
    Registrato dal
    Jan 2007
    Messaggi
    395
    codice:
    <%@LANGUAGE="VBSCRIPT"%>
    <%
    
    strcodice = Session("codiceclub")
    
    Session.timeout = 120 '120 minuti
    
     %>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <META content="text/html; charset=windows-1252" http-equiv=Content-Type>
    <META content="Boninsegna Ottavio" name=author>
    <META content="14 days" name=revisit-after>
    <META content=ALL name=ROBOTS>
    <META content="MSHTML 5.00.2314.1000" name=GENERATOR>
    <LINK REL="STYLESHEET" HREF="../../user/style/figsp-style.css" TYPE="text/css">
    
    <title></title>
    
    
    </head>
    <body bgcolor="#C7E2FA" topMargin=20>
    <%
    Set objConn = Server.CreateObject("ADODB.Connection")
    strUserconn= Application("dbUserconn")
    objConn.Open strUserConn
    
    submitted = Request.Querystring("submitted")
    
    'si, ma è clickata la Form?
    If submitted then
    
    'si, è clickata quindi cambiamo i dati
    codicegara = Request.QueryString("codicegara")
    
    'raccogliamo i dati della nostra form
    
    	data = Request.Form("data")
    	tipogara = Request.Form("tipogara")
    	denominazione = Request.Form("denominazione")
    	codicegiornata = Request.Form("codicegiornata")
    	codicecampo = Request.Form("codicecampo")
    	codorg = Request.Form("codorg")
    	numerogiri = Request.Form("numerogiri")
    	girisquadre = Request.Form("girisquadre")
    	scadenza = Request.Form("scadenza")
    	scadenzaora = Request.Form("scadenzaora")
    	invito = Request.Form("invito")
    	bangolf = Request.Form("bangolf")
    		
    
    'costruiamo la query
    strsql = "Update gare"
    strsql = strsql & " SET "
    strsql = strsql & "data = '" & data & "', "
    strsql = strsql & "tipogara = '" & tipogara & "', "
    strsql = strsql & "denominazione = '" & denominazione & "', "
    strsql = strsql & "codicegiornata = '" & codicegiornata &"', "
    strsql = strsql & "codicecampo = '" & codicecampo & "', "
    strsql = strsql & "codorg = '" & codorg & "', "
    strsql = strsql & "numerogiri = '" & numerogiri & "', "
    strsql = strsql & "scadenza = '" & scadenza & "', "
    strsql = strsql & "scadenzaora = '" & scadenzaora & "', "
    strsql = strsql & "invito = '" & invito & "', "
    strsql = strsql & "bangolf = '" & bangolf & "' "
    strSQL = strSQL & "where codicegara = " & Request.QueryString("codicegara") & ""
    
    Set objConn = Server.CreateObject("ADODB.Connection")
    strUserconn= Application("dbUserconn")
    objConn.Open strUserConn
    
    Set gioc = Server.CreateObject("ADODB.Recordset")
    
    'se hai dei guai costruendo questa, metti un
    '	Response.Write strsql & "
    "
    '	response.flush
    
    	gioc.open strSQL,objConn,3,1
    
    response.redirect "elenco_gare.asp"
    
    objConn.Close
    Set objConn = Nothing
    else
    
    'ancora non abbiamo clickato niente e vogliamo solo vedere
    codicegara = Request.QueryString("codicegara")
    strsql = "select * from gare where codicegara = " & codicegara
    
    Set objRs = Server.CreateObject("ADODB.Recordset")
      objRs.open strSQL,objConn,3,1
    
    'vendemmia il recordset
    
    data = objRs("data")
    tipogara = objRs("tipogara")
    denominazione = objRs("denominazione")
    codicegiornata = objRs("codicegiornata")
    codicecampo = objRs("codicecampo")
    codorg = objRs("codorg")
    numerogiri = objRs("numerogiri")
    girisquadre = objRs("girisquadre")
    scadenza = objRs("scadenza")
    scadenzaora = objRs("scadenzaora")
    invito = objRs("invito")
    bangolf = objRs("bangolf")
    
    %>
    
    <table align="center" border="1" width="750" cellpadding="2" cellspacing="2">
    <tr><th colspan="27" align="center"><font size="+2" color="#003399">Modifica Gara</font></th></tr>
    </table>
    
    <FORM name="iscrizione" ACTION="modifica_gare.asp?submitted=true&codicegara=<%= objRs("codicegara") %>" METHOD="post" onsubmit="return verificadata();" style="margin-bottom: 5px; margin-top: 5px;">
    
    <table border="1" width="750" cellpadding="2" cellspacing="2" align="center">
    <tr>
    <td width="100" align="center" class="intcl10c">DATA</td>
    <td width="100" align="center" class="intcl10c">TIPO GARA</td>
    <td width="275" align="center" class="intcl10c">LOCALITA'</td>
    <td width="275" align="center" class="intcl10c">DESCRIZIONE</td>
    </tr>
    <tr>
    <td width="100" align="center" class="c8C"><input type="text" name="data" size="10" maxlength="10" title="data" id="data" value="<%= data %>"></td>
    <td width="100" align="left" class="c8c">
    <select name="TipoGara" title="TipoGara">
    <option selected value=<%= tipogara %>><%= tipogara %></option>
    <option value="C">C</option>
    <option value="IT">IT</option>
    <option value="ITL">ITL</option>
    <option value="R">R</option>
    <option value="L">L</option>
    <option value="A">A</option>
    </select>
    </td>
    <td width="275" align="center" class="c8l"><input name="denominazione" type="text" size="30" maxlength="50" value="<%= denominazione %>"></td>
    <td width="275" align="center" class="c8l">
    <select name="codicegiornata" style="width:95%">
    <option value="<%= descrizionegiornata %>"><%= descrizionegiornata %></option>
    <%
    Set objConn = Server.CreateObject("ADODB.Connection")
    struserconn= Application("dbuserconn")
    objConn.Open struserConn
    
    strsql = "select * from giornate order by descrizionegiornata"
    set objRS = objConn.Execute(strsql)
    
    do while not objRs.EOF
    %>
    <option value="<%=objrs("id")%>"<% if objrs("id") = codicegiornata then %> selected="selected"<% end if %>><%=objrs("descrizionegiornata") %></option>
    <%
    objRs.MoveNext
    loop
       objRs.close
    '  ObjConn.close
    
    %>
    </select></td>
    
    </tr>
    </table>
    
    <table border="1" width="750" cellpadding="2" cellspacing="2" align="center">
    <tr>
    <td width="375" align="center" class="intcl10c">CAMPO</td>
    <td width="375" align="center" class="intcl10c">CLUB ORGANIZZATORE</td>
    </tr>
    <tr>
    <td width="375" align="center" class="c8l">
    <select name="codicecampo" style="width:95%">
    <option value="<%= campo %>"><%= campo %> - <%= id_spec %></option>
    <%
    'Set objConn = Server.CreateObject("ADODB.Connection")
    'struserconn= Application("dbuserconn")
    'objConn.Open struserConn
    
    strsql = "select * from campi order by campo"
    set objRS = objConn.Execute(strsql)
    
    do while not objRs.EOF
    %>
    <option value="<%=objrs("id")%>"<% if objrs("id") = codicecampo then %> selected="selected"<% end if %>><%=objrs("campo") &" - " & objRs("id_spec")%></option>
    <%
    objRs.MoveNext
    loop
       objRs.close
    '   ObjConn.close
    
    %>
    </select></td>
    
    <td width="375" align="center" class="c8l">
    <select name="codorg" style="width:80%">
    <option value="<%= nomeclub %>"><%= nomeclub %></option>
    <%
    
    sql = "select * from clubs "
    sql = sql & " where flgcanc = false "
    sql = sql & " AND permessi = 'CLU' OR permessi = 'REG' "
    sql = sql & " order by codiceclub"
    set club = objConn.Execute(sql)
    
    do while not club.EOF
    %>
    <option value="<%=club("codiceclub")%>"<% if club("codiceclub") = codorg then %> selected="selected"<% end if %>><%=club("nomeclub")%></option>
    <%
    club.MoveNext
    loop
    %>
    </select></td>
    </tr>
    </table>
    
    <table border="1" width="750" cellpadding="2" cellspacing="2" align="center">
    <tr>
    <td width="175" align="center" class="intcl10c">NUMERO GIRI</td>
    <td width="175" align="center" class="intcl10c">NUMERO GIRI SQUADRE</td>
    <td width="200" align="center" class="intcl10c">DATA SCANDENZA</td>
    <td width="200" align="center" class="intcl10c">ORA SCADENZA</td>
    </tr>
    </table>
    <table border="1" width="750" cellpadding="2" cellspacing="2" align="center">
    <tr>
    <td width="175" align="center" class="c8C"><input type="text" name="numerogiri" size="10" maxlength="10" value="<%= numerogiri %>"></td>
    <td width="175" align="center" class="c8C"><input type="text" name="numerogirisqaudre" size="10" maxlength="10" value="<%= girisquadre %>"></td>
    <td width="200" align="center" class="c8C"><input type="text" name="scadenza" size="15" maxlength="10" id="data" value="<%= scadenza %>"></td>
    <td width="200" align="center" class="c8C"><input type="text" name="scadenzaora" size="15" maxlength="10" value="<%= formatDateTime(scadenzaora, vbShortTime) %>"></td>
    </tr>
    </table>
    <table border="1" width="750" cellpadding="2" cellspacing="2" align="center">
    <tr>
    <td width="750" align="center" class="intcl10c">INVITO (solo per cancellarlo)</td>
    </tr>
    </table>
    <table border="1" width="750" cellpadding="2" cellspacing="2" align="center">
    <tr>
    <td width="750" class="c8l"><input type="text" name="invito" size="88" maxlength="250" value="<%= invito %>"></td>
    </tr>
    </table>
    
    <table border="1" width="750" cellpadding="2" cellspacing="2" align="center">
    <tr>
    <td width="750" align="center" class="intcl10c">COLLEGAMENTO BANGOLF (inserisci il percorso completo)</td>
    </tr>
    </table>
    <table border="1" width="750" cellpadding="2" cellspacing="2" align="center">
    <tr>
    <td width="750" class="c8l"><input type="text" name="bangolf" size="88" maxlength="250" value="<%= bangolf %>"></td>
    </tr>
    </table>
    
    <table align="center" width="40%" border="0" cellpadding="6" cellspacing="2">
    <tr>
    <td align="right"><input type="submit" name="submit" value="Inserisci"></td>
    <td align="left"><input type="reset" name="reset" value="Reset"></td>
    </tr>
    </table>
    </form>
    <%
    end if
    %>
    </body>
    </html>

  4. #4
    'se hai dei guai costruendo questa, metti un
    ' Response.Write strsql & "
    "
    ' response.flush


    decommenta e facci vedere cosa vale strsql

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.