Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 378
  • Last Modified:

preventing fields from updating (SQL Update)

Hi all

I use the code below (asp Page) to update records in our customer DB

------------------------------------------------------------

<%@ codepage = 1250 LCID = 2055  %>
<% If Session("project6_status") <> "login" Then Response.Redirect "login.asp" %>
<%
Response.expires = 0
Response.expiresabsolute = Now() - 1
Response.addHeader "pragma", "no-cache"
Response.addHeader "cache-control", "private"
Response.CacheControl = "no-cache"
%>
<!--#include file="db.asp"-->
<!--#include file="aspmkrfn.asp"-->
<%
Response.Buffer = True
key = Request.Querystring("key")
If key = "" Or IsNull(key) Then key = Request.Form("key")
If key = "" Or IsNull(key) Then Response.Redirect "Kundenlist.asp"

' Get action
a = Request.Form("a")
If a = "" Or IsNull(a) Then
    a = "I"    ' Display with input box
End If

' Get fields from form
x_ID = Request.Form("x_ID")
x_Domain = Request.Form("x_Domain")
x_TLD = Request.Form("x_TLD")
x_LoginName = Request.Form("x_LoginName")
x_Passwort = Request.Form("x_Passwort")
x_Service = Request.Form("x_Service")
x_Kundennummer = Request.Form("x_Kundennummer")
x_FK_ID_Server = Request.Form("x_FK_ID_Server")
x_Erfasst_am = Request.Form("x_Erfasst_am")
x_gesperrt = Request.Form("x_gesperrt")
x_Bemerkungen = Request.Form("x_Bemerkungen")
x_alte_infos = Request.Form("x_alte_infos")
x_alg_infos = Request.Form("x_alg_infos")
x_best_anm = Request.Form("x_best_anm")
x_Reseller = Request.Form("x_Reseller")
x_Reseller_nummer = Request.Form("x_Reseller_nummer")
x_Anrede_best = Request.Form("x_Anrede_best")
x_Firma_best = Request.Form("x_Firma_best")
x_Nname_best = Request.Form("x_Nname_best")
x_Vorname_best = Request.Form("x_Vorname_best")
x_Strasse_best = Request.Form("x_Strasse_best")
x_Postfach_best = Request.Form("x_Postfach_best")
x_PLZ_best = Request.Form("x_PLZ_best")
x_Ort_best = Request.Form("x_Ort_best")
x_Telefon_best = Request.Form("x_Telefon_best")
x_Fax_best = Request.Form("x_Fax_best")
x_Land_best = Request.Form("x_Land_best")
x_Email_best = Request.Form("x_Email_best")
x_Anrede_re = Request.Form("x_Anrede_re")
x_Firma_re = Request.Form("x_Firma_re")
x_Nname_re = Request.Form("x_Nname_re")
x_Vorname_re = Request.Form("x_Vorname_re")
x_Strasse_re = Request.Form("x_Strasse_re")
x_Postfach_re = Request.Form("x_Postfach_re")
x_PLZ_re = Request.Form("x_PLZ_re")
x_Ort_re = Request.Form("x_Ort_re")
x_Telefon_re = Request.Form("x_Telefon_re")
x_Fax_re = Request.Form("x_Fax_re")
x_Land_re = Request.Form("x_Land_re")
x_Email_re = Request.Form("x_Email_re")
x_Anrede_tec = Request.Form("x_Anrede_tec")
x_Firma_tec = Request.Form("x_Firma_tec")
x_Nname_tec = Request.Form("x_Nname_tec")
x_Vorname_tec = Request.Form("x_Vorname_tec")
x_Strasse_tec = Request.Form("x_Strasse_tec")
x_Postfach_tec = Request.Form("x_Postfach_tec")
x_PLZ_tec = Request.Form("x_PLZ_tec")
x_Ort_tec = Request.Form("x_Ort_tec")
x_Telefon_tec = Request.Form("x_Telefon_tec")
x_Fax_tec = Request.Form("x_Fax_tec")
x_Land_tec = Request.Form("x_Land_tec")
x_Email_tec = Request.Form("x_Email_tec")
x_Kontrolliert = Request.Form("x_Kontrolliert")
x_erfasst_durch = Request.Form("x_erfasst_durch")
x_MXrecord = Request.Form("x_MXrecord")
x_Survey = Request.Form("x_Survey")
x_sperrdatum = Request.Form("x_sperrdatum")

' Open Connection to the database
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open xDb_Conn_Str
Select Case a
    Case "I": ' Get a record to display
        tkey = "" & key & ""
        strsql = "SELECT * FROM [Kunden] WHERE [ID]=" & tkey
        Set rs = Server.CreateObject("ADODB.Recordset")
        rs.Open strsql, conn
        If rs.Eof Then
            Response.Clear
            Response.Redirect "Kundenlist.asp"
        Else
            rs.MoveFirst
        End If


        ' Get the field contents
        x_ID = rs("ID")
        x_Domain = rs("Domain")
        x_TLD = rs("TLD")
        x_LoginName = rs("LoginName")
        x_Passwort = rs("Passwort")
        x_Service = rs("Service")
        x_Kundennummer = rs("Kundennummer")
        x_FK_ID_Server = rs("FK_ID_Server")
        x_Erfasst_am = rs("Erfasst_am")
        x_gesperrt = rs("gesperrt")
        x_Bemerkungen = rs("Bemerkungen")
        x_alte_infos = rs("alte_infos")
        x_alg_infos = rs("alg_infos")
        x_best_anm = rs("best_anm")
        x_Reseller = rs("Reseller")
        x_Reseller_nummer = rs("Reseller_nummer")
        x_Anrede_best = rs("Anrede_best")
        x_Firma_best = rs("Firma_best")
        x_Nname_best = rs("Nname_best")
        x_Vorname_best = rs("Vorname_best")
        x_Strasse_best = rs("Strasse_best")
        x_Postfach_best = rs("Postfach_best")
        x_PLZ_best = rs("PLZ_best")
        x_Ort_best = rs("Ort_best")
        x_Telefon_best = rs("Telefon_best")
        x_Fax_best = rs("Fax_best")
        x_Land_best = rs("Land_best")
        x_Email_best = rs("Email_best")
        x_Anrede_re = rs("Anrede_re")
        x_Firma_re = rs("Firma_re")
        x_Nname_re = rs("Nname_re")
        x_Vorname_re = rs("Vorname_re")
        x_Strasse_re = rs("Strasse_re")
        x_Postfach_re = rs("Postfach_re")
        x_PLZ_re = rs("PLZ_re")
        x_Ort_re = rs("Ort_re")
        x_Telefon_re = rs("Telefon_re")
        x_Fax_re = rs("Fax_re")
        x_Land_re = rs("Land_re")
        x_Email_re = rs("Email_re")
        x_Anrede_tec = rs("Anrede_tec")
        x_Firma_tec = rs("Firma_tec")
        x_Nname_tec = rs("Nname_tec")
        x_Vorname_tec = rs("Vorname_tec")
        x_Strasse_tec = rs("Strasse_tec")
        x_Postfach_tec = rs("Postfach_tec")
        x_PLZ_tec = rs("PLZ_tec")
        x_Ort_tec = rs("Ort_tec")
        x_Telefon_tec = rs("Telefon_tec")
        x_Fax_tec = rs("Fax_tec")
        x_Land_tec = rs("Land_tec")
        x_Email_tec = rs("Email_tec")
        x_Kontrolliert = rs("Kontrolliert")
        x_erfasst_durch = rs("erfasst_durch")
        x_MXrecord = rs("MXrecord")
        x_Survey = rs("Survey")
        x_sperrdatum = rs("sperrdatum")
        rs.Close
        Set rs = Nothing
    Case "U": ' Update

   
        ' Open record
        tkey = "" & key & ""
        strsql = "SELECT * FROM [Kunden] WHERE [ID]=" & tkey
        Set rs = Server.CreateObject("ADODB.Recordset")
        rs.Open strsql, conn, 1, 2
        If rs.Eof Then
            Response.Clear
            Response.Redirect "Kundenlist.asp"
        End If
        tmpFld = x_ID
        If Not IsNumeric(tmpFld) Then tmpFld = 0
        rs("ID") = CLng(tmpFld)
        tmpFld = Trim(x_Domain)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Domain") = tmpFld
        tmpFld = Trim(x_TLD)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("TLD") = tmpFld
        tmpFld = Trim(x_LoginName)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("LoginName") = tmpFld
        tmpFld = Trim(x_Passwort)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Passwort") = tmpFld
        tmpFld = Trim(x_Service)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Service") = tmpFld
        tmpFld = Trim(x_Kundennummer)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Kundennummer") = tmpFld
        tmpFld = Trim(x_FK_ID_Server)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("FK_ID_Server") = tmpFld
        tmpFld = x_Erfasst_am
        If Not IsNumeric(tmpFld) Then tmpFld = 0
        rs("Erfasst_am") = CLng(tmpFld)
        tmpFld = x_gesperrt
        If tmpFld = "1" Then
            rs("gesperrt") = True
        Else
            rs("gesperrt") = False
        End If
        tmpFld = Trim(x_Bemerkungen)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Bemerkungen") = tmpFld
        tmpFld = Trim(x_alte_infos)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("alte_infos") = tmpFld
        tmpFld = Trim(x_alg_infos)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("alg_infos") = tmpFld
        tmpFld = Trim(x_best_anm)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("best_anm") = tmpFld
        tmpFld = x_Reseller
        If tmpFld = "1" Then
            rs("Reseller") = True
        Else
            rs("Reseller") = False
        End If
        tmpFld = Trim(x_Reseller_nummer)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Reseller_nummer") = tmpFld
        tmpFld = Trim(x_Anrede_best)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Anrede_best") = tmpFld
        tmpFld = Trim(x_Firma_best)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Firma_best") = tmpFld
        tmpFld = Trim(x_Nname_best)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Nname_best") = tmpFld
        tmpFld = Trim(x_Vorname_best)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Vorname_best") = tmpFld
        tmpFld = Trim(x_Strasse_best)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Strasse_best") = tmpFld
        tmpFld = Trim(x_Postfach_best)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Postfach_best") = tmpFld
        tmpFld = Trim(x_PLZ_best)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("PLZ_best") = tmpFld
        tmpFld = Trim(x_Ort_best)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Ort_best") = tmpFld
        tmpFld = Trim(x_Telefon_best)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Telefon_best") = tmpFld
        tmpFld = Trim(x_Fax_best)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Fax_best") = tmpFld
        tmpFld = Trim(x_Land_best)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Land_best") = tmpFld
        tmpFld = Trim(x_Email_best)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Email_best") = tmpFld
        tmpFld = Trim(x_Anrede_re)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Anrede_re") = tmpFld
        tmpFld = Trim(x_Firma_re)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Firma_re") = tmpFld
        tmpFld = Trim(x_Nname_re)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Nname_re") = tmpFld
        tmpFld = Trim(x_Vorname_re)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Vorname_re") = tmpFld
        tmpFld = Trim(x_Strasse_re)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Strasse_re") = tmpFld
        tmpFld = Trim(x_Postfach_re)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Postfach_re") = tmpFld
        tmpFld = Trim(x_PLZ_re)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("PLZ_re") = tmpFld
        tmpFld = Trim(x_Ort_re)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Ort_re") = tmpFld
        tmpFld = Trim(x_Telefon_re)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Telefon_re") = tmpFld
        tmpFld = Trim(x_Fax_re)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Fax_re") = tmpFld
        tmpFld = Trim(x_Land_re)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Land_re") = tmpFld
        tmpFld = Trim(x_Email_re)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Email_re") = tmpFld
        tmpFld = Trim(x_Anrede_tec)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Anrede_tec") = tmpFld
        tmpFld = Trim(x_Firma_tec)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Firma_tec") = tmpFld
        tmpFld = Trim(x_Nname_tec)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Nname_tec") = tmpFld
        tmpFld = Trim(x_Vorname_tec)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Vorname_tec") = tmpFld
        tmpFld = Trim(x_Strasse_tec)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Strasse_tec") = tmpFld
        tmpFld = Trim(x_Postfach_tec)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Postfach_tec") = tmpFld
        tmpFld = Trim(x_PLZ_tec)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("PLZ_tec") = tmpFld
        tmpFld = Trim(x_Ort_tec)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Ort_tec") = tmpFld
        tmpFld = Trim(x_Telefon_tec)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Telefon_tec") = tmpFld
        tmpFld = Trim(x_Fax_tec)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Fax_tec") = tmpFld
        tmpFld = Trim(x_Land_tec)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Land_tec") = tmpFld
        tmpFld = Trim(x_Email_tec)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Email_tec") = tmpFld
        tmpFld = x_Kontrolliert
        If tmpFld = "1" Then
            rs("Kontrolliert") = True
        Else
            rs("Kontrolliert") = False
        End If
        tmpFld = Trim(x_erfasst_durch)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("erfasst_durch") = tmpFld
        tmpFld = Trim(x_MXrecord)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("MXrecord") = tmpFld
        tmpFld = Trim(x_Survey)
        If Trim(tmpFld) & "x" = "x" Then tmpFld = Null
        rs("Survey") = tmpFld
        tmpFld = x_sperrdatum
        If IsDate(tmpFld) Then
            rs("sperrdatum") = CDate(tmpFld)
        Else
            rs("sperrdatum") = Null
        End If
        rs.Update
        rs.Close
        Set rs = Nothing
        conn.Close
        Set conn = Nothing
       
        If x_gesperrt THEN
        myNewDateTime = NOW ()
        tkey = "" & key & ""
        updatesql = "UPDATE [Kunden] SET sperrdatum ='" & myNewDateTime & "' WHERE [ID]=" & tkey
        Set conn = Server.CreateObject("ADODB.CONNECTION")
        Set rs = Server.CreateObject("ADODB.Recordset")
        conn.Open xDb_Conn_Str
        conn.execute(updatesql)
        conn.close
        Set conn = Nothing
        End If
               
        Response.Clear
        Response.Redirect "Kundenlist.asp"
End Select
%>
<!--#include file="header.asp"-->
<p><font class="formtag">Kunden Eintrag bearbeiten<br>
    <br>
    <a href="Kundenlist.asp">Zurueck zur Uebersicht </a></font></p>
<script language="JavaScript" src="ew.js"></script>
<script language="JavaScript">
<!-- start Javascript
function  EW_checkMyForm(EW_this) {
if (EW_this.x_ID && !EW_checkinteger(EW_this.x_ID.value)) {
        if (!EW_onError(EW_this, EW_this.x_ID, "TEXT", "Incorrect integer - ID"))
            return false;
        }
if (EW_this.x_Erfasst_am && !EW_checkinteger(EW_this.x_Erfasst_am.value)) {
        if (!EW_onError(EW_this, EW_this.x_Erfasst_am, "TEXT", "Incorrect integer - Erfasst am"))
            return false;
        }
return true;
}
// end JavaScript -->
</script>
<form onSubmit="return EW_checkMyForm(this);"  action="Kundenedit.asp" method="post">
<p>
<input type="hidden" name="a" value="U">
<input type="hidden" name="key" value="<%= key %>">
<table border="0" cellspacing="1" cellpadding="4" bgcolor="#CCCCCC">
<tr>
<td width="104" bgcolor="#0099CC"><font color="#FFFFFF"><font class="formtag">ID</font>&nbsp;</font></td>
<td width="477" bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_ID" size="30" value="<%= Server.HTMLEncode(x_ID&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0099CC"><font color="#FFFFFF"><font class="formtag">Domain</font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Domain" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Domain&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0099CC"><font color="#FFFFFF"><font class="formtag">TLD</font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_TLD" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_TLD&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0099CC"><font color="#FFFFFF"><font class="formtag">Login Name</font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_LoginName" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_LoginName&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0099CC"><font color="#FFFFFF"><font class="formtag">Passwort</font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Passwort" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Passwort&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0099CC"><font color="#FFFFFF"><font class="formtag">Service</font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><select name="x_Service" id="x_Service">
  <option value="Domain Parking 1 MB">Domain Parking 1 MB</option>
  <option value="Startup Paket 50 MB">Startup Paket 50 MB</option>
  <option value="Mini Paket 250 MB">Mini Paket 250 MB</option>
  <option value="Power Paket 300 MB">Power Paket 300 MB</option>
  <option value="Medium Paket 400 MB">Medium Paket 400 MB</option>
  <option value="Premium Paket 650 MB">Premium Paket 650 MB</option>
  <option value="Special Paket 1000 MB">Special Paket 1000 MB</option>
  <option value="Mailhost 10">Mailhost 10 </option>
  <option value="Mailhost 20">Mailhost 20</option>
  <option value="Mailhost 50">Mailhost 50</option>
  <option value="Mailhost 80">Mailhost 80</option>
  <option value="Mailhost 100">Mailhost 100</option>
  <option value="Housing">Housing</option>
</select>  &nbsp;</td>
</tr>
<tr>
<td bgcolor="#0099CC"><font color="#FFFFFF"><font class="formtag">Kundennummer</font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Kundennummer" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Kundennummer&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0099CC"><font color="#FFFFFF"><font class="formtag">FK ID Server</font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><% If Session("Kunden_masterkey") <> "" Then
x_FK_ID_Server = Session("Kunden_masterkey") %>
<% Response.Write x_FK_ID_Server %><input type="hidden" name="x_FK_ID_Server" value="<%= x_FK_ID_Server %>">
<% Else %>
<select name="x_FK_ID_Server" id="x_FK_ID_Server">
  <option value="web001.webspace4you.ch/domainadminlevel (Linux) FTP Host = web001.webspace4you.ch">web001.webspace4you.ch/domainadminlevel (Linux) FTP Host = web001.webspace4you.ch</option>
  <option value="web002.webspace4you.ch/domainadminlevel (Linux) FTP Host = web002.webspace4you.ch">web002.webspace4you.ch/domainadminlevel (Linux) FTP Host = web002.webspace4you.ch</option>
  <option value="web003.webspace4you.ch/domainadminlevel (Linux) FTP Host= web003.webspace4you.ch">web003.webspace4you.ch/domainadminlevel (Linux) FTP Host= web003.webspace4you.ch</option>
  <option value="web004.webspace4you.ch/domainadminlevel (Linux) FTP Host = web004.webspace4you.ch">web004.webspace4you.ch/domainadminlevel (Linux) FTP Host = web004.webspace4you.ch</option>
  <option value="web005.webspace4you.ch/domainadminlevel (Linux) FTP Host = web005.webspace4you.ch">web005.webspace4you.ch/domainadminlevel (Linux) FTP Host = web005.webspace4you.ch</option>
  <option value="web011.webspace4you.ch/hc (Windows) FTP Host = web011.webspace4you.ch">web011.webspace4you.ch/hc (Windows) FTP Host = web011.webspace4you.ch</option>
  <option value="web012.webspace4you.ch/hc (Windows) FTP Host = web012.webspace4you.ch">web012.webspace4you.ch/hc (Windows) FTP Host = web012.webspace4you.ch</option>
  <option value="web013.webspace4you.ch/hc (Windows) FTP Host = web013.webspace4you.ch">web013.webspace4you.ch/hc (Windows) FTP Host = web013.webspace4you.ch</option>
  <option value="web014.webspace4you.ch/hc (Windows) FTP Host = web014.webspace4you.ch">web014.webspace4you.ch/hc (Windows) FTP Host = web014.webspace4you.ch</option>
  <option value="web015.webspace4you.ch/hc (Windows) FTP Host = web015.webspace4you.ch">web015.webspace4you.ch/hc (Windows) FTP Host = web015.webspace4you.ch</option>
  <option value="web016.webspace4you.ch/hc (Windows) FTP Host = web016.webspace4you.ch">web016.webspace4you.ch/hc (Windows) FTP Host = web016.webspace4you.ch</option>
  <option value="Housing">Housing</option>
</select>
<% End If %>
</font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0099CC"><font color="#FFFFFF"><font class="formtag">Erfasst am</font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Erfasst_am" size="30" value="<%= Server.HTMLEncode(x_Erfasst_am&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0099CC"><font color="#FFFFFF"><font class="formtag">gesperrt</font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="radio" name="x_gesperrt"<% If x_gesperrt = True Then %> checked<% End If %> value="1"><%= "Ja" %><input type="radio" name="x_gesperrt"<% If x_gesperrt = False Then %> checked<% End If %> value="0"><%= "Nein" %></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0099CC"><font color="#FFFFFF"><font class="formtag">Bemerkungen</font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><textarea cols=35 rows=4 name="x_Bemerkungen"><%= x_Bemerkungen %></textarea></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0099CC"><font color="#FFFFFF"><font class="formtag">alte infos</font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><textarea cols=35 rows=4 name="x_alte_infos"><%= x_alte_infos %></textarea></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0099CC"><font color="#FFFFFF"><font class="formtag">alg infos</font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><textarea cols=35 rows=4 name="x_alg_infos"><%= x_alg_infos %></textarea></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0099CC"><font color="#FFFFFF"><font class="formtag">best anm</font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><textarea cols=35 rows=4 name="x_best_anm"><%= x_best_anm %></textarea></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0099CC"><font color="#FFFFFF"><font class="formtag">Reseller</font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="radio" name="x_Reseller"<% If x_Reseller = True Then %> checked<% End If %> value="1"><%= "Ja" %><input type="radio" name="x_Reseller"<% If x_Reseller = False Then %> checked<% End If %> value="0"><%= "Nein" %></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0099CC"><font color="#FFFFFF"><font class="formtag">Reseller nummer</font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Reseller_nummer" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Reseller_nummer&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0099CC"><font color="#FFFFFF"><font class="formtag">Anrede Besteller </font></font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Anrede_best" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Anrede_best&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0099CC"><font color="#FFFFFF"><font class="formtag">Firma Besteller </font></font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Firma_best" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Firma_best&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0099CC"><font color="#FFFFFF"><font class="formtag">Nachname Besteller</font></font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Nname_best" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Nname_best&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0099CC"><font color="#FFFFFF"><font class="formtag">Vorname Besteller</font></font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Vorname_best" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Vorname_best&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0099CC"><font color="#FFFFFF"><font class="formtag">Strasse Besteller</font></font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Strasse_best" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Strasse_best&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0099CC"><font color="#FFFFFF"><font class="formtag">Postfach Besteller</font></font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Postfach_best" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Postfach_best&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0099CC"><font color="#FFFFFF"><font class="formtag">PLZ Besteller </font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_PLZ_best" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_PLZ_best&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0099CC"><font color="#FFFFFF"><font class="formtag">Ort Besteller </font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Ort_best" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Ort_best&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0099CC"><font color="#FFFFFF"><font class="formtag">Telefon Besteller</font></font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Telefon_best" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Telefon_best&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0099CC"><font color="#FFFFFF"><font class="formtag">Fax Besteller </font></font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Fax_best" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Fax_best&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0099CC"><font color="#FFFFFF"><font class="formtag">Land Besteller </font></font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Land_best" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Land_best&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0099CC"><font color="#FFFFFF"><font class="formtag">Email Besteller </font></font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Email_best" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Email_best&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0033FF"><font color="#FFFFFF"><font class="formtag">Anrede Rechungsempf.</font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Anrede_re" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Anrede_re&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0033FF"><font color="#FFFFFF"><font class="formtag">Firma Rechnungsempf</font></font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Firma_re" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Firma_re&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0033FF"><font color="#FFFFFF"><font class="formtag">Nachname Rechnungsem.</font></font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Nname_re" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Nname_re&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0033FF"><font color="#FFFFFF"><font class="formtag">Vorname Rechnungsempf</font></font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Vorname_re" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Vorname_re&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0033FF"><font color="#FFFFFF"><font class="formtag">Strasse Rechnungsempf.</font></font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Strasse_re" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Strasse_re&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0033FF"><font color="#FFFFFF"><font class="formtag">Postfach Rechnungsempf</font></font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Postfach_re" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Postfach_re&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0033FF"><font color="#FFFFFF"><font class="formtag">PLZ Rechnungsempf.</font></font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_PLZ_re" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_PLZ_re&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0033FF"><font color="#FFFFFF"><font class="formtag">Ort Rechnungsempf.</font></font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Ort_re" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Ort_re&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0033FF"><font color="#FFFFFF"><font class="formtag">Telefon Rechnungsempf</font></font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Telefon_re" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Telefon_re&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0033FF"><font color="#FFFFFF"><font class="formtag">Fax Rechnungsempf.</font></font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Fax_re" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Fax_re&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0033FF"><font color="#FFFFFF"><font class="formtag">Land Rechnungsempf.</font></font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Land_re" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Land_re&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0033FF"><font color="#FFFFFF"><font class="formtag">Email Rechnungsempf.</font></font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Email_re" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Email_re&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#66CCFF"><font color="#FFFFFF"><font class="formtag">Anrede Tech. Kontakt</font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Anrede_tec" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Anrede_tec&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#66CCFF"><font color="#FFFFFF"><font class="formtag">Firma </font><font color="#FFFFFF"><font class="formtag">Tech. Kontakt</font>&nbsp;</font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Firma_tec" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Firma_tec&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#66CCFF"><font color="#FFFFFF"><font class="formtag">Nachname <font color="#FFFFFF">Tech. Kontakt</font></font></font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Nname_tec" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Nname_tec&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#66CCFF"><font color="#FFFFFF"><font class="formtag">Vorname </font><font color="#FFFFFF"><font class="formtag">Tech. Kontakt</font></font></font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Vorname_tec" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Vorname_tec&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#66CCFF"><font color="#FFFFFF"><font class="formtag">Strasse </font><font color="#FFFFFF"><font class="formtag">Tech. Kontakt</font>&nbsp;</font></font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Strasse_tec" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Strasse_tec&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#66CCFF"><font color="#FFFFFF"><font class="formtag">Postfach </font><font color="#FFFFFF"><font class="formtag">Tech. Kontakt</font></font></font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Postfach_tec" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Postfach_tec&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#66CCFF"><font color="#FFFFFF"><font class="formtag">PLZ </font><font color="#FFFFFF"><font class="formtag">Tech. Kontakt</font>&nbsp;</font></font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_PLZ_tec" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_PLZ_tec&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#66CCFF"><font color="#FFFFFF"><font class="formtag">Ort </font><font color="#FFFFFF"><font class="formtag">Tech. Kontakt</font>&nbsp;</font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Ort_tec" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Ort_tec&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#66CCFF"><font color="#FFFFFF"><font class="formtag">Telefon </font><font color="#FFFFFF"><font class="formtag">Tech. Kontakt</font>&nbsp;</font></font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Telefon_tec" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Telefon_tec&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#66CCFF"><font color="#FFFFFF"><font class="formtag">Fax </font><font color="#FFFFFF"><font class="formtag">Tech. Kontakt</font>&nbsp;</font></font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Fax_tec" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Fax_tec&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#66CCFF"><font color="#FFFFFF"><font class="formtag">Land </font><font color="#FFFFFF"><font class="formtag">Tech. Kontakt</font></font></font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Land_tec" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Land_tec&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#66CCFF"><font color="#FFFFFF"><font class="formtag">Email </font><font color="#FFFFFF"><font class="formtag">Tech. Kontakt</font>&nbsp;</font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Email_tec" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Email_tec&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0099CC"><font color="#FFFFFF"><font class="formtag">Kontrolliert</font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="radio" name="x_Kontrolliert"<% If x_Kontrolliert = True Then %> checked<% End If %> value="1"><%= "Ja" %><input type="radio" name="x_Kontrolliert"<% If x_Kontrolliert = False Then %> checked<% End If %> value="0"><%= "Nein" %></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#CC66FF"><font color="#FFFFFF"><font class="formtag">erfasst durch</font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_erfasst_durch" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_erfasst_durch&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#009966"><font color="#FFFFFF"><font class="formtag">MXrecord</font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_MXrecord" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_MXrecord&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#660066"><font color="#FFFFFF"><font class="formtag">Survey</font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_Survey" size="30" maxlength="50" value="<%= Server.HTMLEncode(x_Survey&"") %>"></font>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#0099CC"><font color="#FFFFFF"><font class="formtag">sperrdatum</font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><font class="formtag"><input type="text" name="x_sperrdatum" value="<%= Server.HTMLEncode(x_sperrdatum&"") %>"></font>&nbsp;</td>
</tr>
</table>
<p>
<input type="submit" name="Action" value="Bearbeiten">
</form>
<!--#include file="footer.asp"-->
------------------------------------------------------------

but how can prevent some fields from updating

which means, if i set the value "gesperrt" to True, all other fields (especially x_FK_ID_Server and x_Service) shoud be untouched

at moment if i update the record it will then delete the content of the FK_ID_Server and Service Fields in the MS SQL DB

many thanks for your help

best regards

E.Altherr

 
 
0
elias12
Asked:
elias12
  • 2
1 Solution
 
casstdCommented:
Hi,

        You can use
qry_Update =  update tblname set filedname1='"&request.form("text1"), fieldname2='"&request.form("text2"),

'You can set condition here

if gesperrt = true then
     ' exclude the field

else
     qry_Update = qry_Update & " fieldname5='"&request.form("textbox5")&"' where primarykey="&id&";"
'You must write where condition here.
end if

you can add as many field you want.

This way it won't delete the content of the fields that is not updated.
0
 
elias12Author Commented:
ok, you mean if put all fields (which i want to exclude) in the condition, the won't be updated right?

or reverse?

0
 
elias12Author Commented:
hi

i found the solution:

the problem was the following:


action="Kundensperren.asp" method="post">


this action was set to "Kundenedit.asp method =" post"> instead to the above string, so the system calls the wrong page to update the records

the devil often lies in the detail *** grins ***


thanks anyway for your help

best regards

E.Altherr
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now