This is my solution it works almost 100%. Please find my code between '<**> and '</**>.
Sergey: This is what I did. I put a "FieldNameAux" at the right side of the DropDownBox. If the user select something in the combobox that value is taken. If nothing is selected in combobox and something is typed in the "FieldNameAux" then it is validated if exist. If validation is OK the record is saved. That way works ok.
BUT if validation is NOT OK, I show a dialog box explaining what happened then click ok and it CLEANS all the fields SO to continue without loosing it I have to CLICK BACK to correct only and not to type everything again specialy en EDIT MODE.
Please tell me what showld I do to prevent the problem and if there is an easier way to do it.
Thanks
<%@ Language=VBScript %>
<%
If Session("UserID")="" then
Session("MyURL")=request.ServerVariables("SCRIPT_NAME") & "?" & request.ServerVariables("QUERY_STRING")
Response.Redirect "login.asp?message=expired"
End If
if CheckSecurity("", "Edit")<>True Then
Response.Write "<p>" & "You don't have permissions to access this table" & "<a href=""login.asp"">" & "Back to login page" & "</a></p>"
Response.End
end if
%>
<!--#include file="include/jsvariables.asp"-->
<% Call DefineScriptMessages %>
<%
Set myRequest = CreateObject("Scripting.Dictionary")
Set myRequestFiles = CreateObject("Scripting.Dictionary")
if ParseMultiPartForm()=true then
end if
MaxSizeSet=false
%>
<html>
<link REL="stylesheet" href="include/style.css" type="text/css">
<title>Pagos Recibidos Detalle</title>
<!--#include file="include/validate.htm"-->
<!--#include file="include/tbDepositosDetalle_dbconnection.asp"-->
<!--#include file="include/tbDepositosDetalle_variables.asp"-->
<!--#include file="include/tbDepositosDetalle_aspfunctions.asp"-->
<body bgcolor=white onLoad="define('NumeroDeposito', 'IsNumericIsRequired', '<%=Label("NumeroDeposito")%>');define('NumeroDepositoDetalle', 'IsNumericIsRequired', '<%=Label("NumeroDepositoDetalle")%>');define('Monto', 'IsNumeric', '<%=Label("Monto")%>');">
<script language="JavaScript" src="include/ts_picker.js"></script>
<script language="JavaScript" src="include/jsfunctions.js"></script>
<%
'On Error Resume Next
Dim oCat, strADOXTableName
call GetADOXConnection
message=""
myaction=GetRequestForm("todo")
if myaction="view" then myaction="edit"
' open database connection
Set rs = server.CreateObject ("ADODB.Recordset")
set dbConnection = server.CreateObject ("ADODB.Connection")
dbConnection.ConnectionString = strConnection
dbConnection.Open
Call ReportError
' build SQL query to retrieve data
strSQL = gstrSQL
sWhere = AddWrappers(strKeyField) & "=" & gstrQuote & PrepareKeyColumnValue(strTableName, strKeyField, GetRequestForm("editid")) & gstrQuote
if strKeyField2<>"" then sWhere=sWhere & " and " & AddWrappers(strKeyField2) & "=" & gstrQuote2 & Replace(GetRequestForm("editid2"),"'","''") & gstrQuote2
if strKeyField3<>"" then sWhere=sWhere & " and " & AddWrappers(strKeyField3) & "=" & gstrQuote3 & Replace(GetRequestForm("editid3"),"'","''") & gstrQuote3
strSQL = AddWhere(strSQL, sWhere)
' save changes
if (GetRequestForm("editid")<>"" and GetRequestForm("todo")="edit") then
Set rs = Server.CreateObject("ADODB.Recordset")
if GetDatabaseType()=DATABASE_MySQL or GetDatabaseType()=DATABASE_Oracle then rs.CursorLocation = 3
rs.Open strSQL, dbConnection, 1, 2
If not rs.Eof Then
if IsUpdatable(rs.Fields("CheckNumber")) then
nType = GetFieldType(strTableName, "CheckNumber")
' boolean
if nType=11 or (nType=131 and Left(GetRequestForm("CheckNumber"),1)="o") then
if GetRequestForm("CheckNumber")="on" then
strValue="1"
else
strValue="0"
end if
else ' not boolean
if GetRequestForm("CheckNumber")="" and ( nType=72 or nType=133 or nType=134 or nType=135 ) then
strValue = NULL
else
strValue=GetRequestForm("CheckNumber")
' date edit convert
if GetEditFormat("CheckNumber")=EDIT_FORMAT_DATE or IsDateFieldType(nType) then
strValue= FormatDbDate(strValue, DateEditType("CheckNumber"))
end if
if IfNeedQuotes(GetFieldType(strTableName, "CheckNumber"))<>"True" or IsDateFieldType(GetFieldType(strTableName, "CheckNumber")) then
if strValue="" then
strValue=Null
end if
end if
if IsFloat(nType) and strValue<>"" then
strValue = Replace(strValue, ",", ".")
end if
end if
end if
if GetEditFormat("CheckNumber")=EDIT_FORMATFILE then
if GetRequestForm("typeCheckNumber") = "upload1" or GetRequestForm("typeCheckNumber") = "upload2" then
If IsNull(strValue) or GetRequestForm("typeCheckNumber") = "upload1" Then
rs("CheckNumber") = Null
DeleteFile Server.MapPath(GetUploadFolder("CheckNumber") & GetRequestForm("filenameCheckNumber"))
Else
rs("CheckNumber")= strValue
if strValue<>"" then
WriteToFile Server.MapPath(GetUploadFolder("CheckNumber") & strValue), GetRequestForm("fileCheckNumber")
End If
end if
elseif GetEditFormat("CheckNumber")<>FORMAT_DATABASE_IMAGE and GetEditFormat("CheckNumber")<>FORMAT_DATABASE_FILE then
rs("CheckNumber") = strValue
else
if GetRequestForm("typeCheckNumber") = "file1" or GetRequestForm("typeCheckNumber") = "file2" then
If IsNull(strValue) or GetRequestForm("typeCheckNumber") = "file1" Then
rs("CheckNumber") = Null
Else
rs("CheckNumber").AppendChunk strValue
End If
end if
end if
end if
if IsUpdatable(rs.Fields("Monto")) then
nType = GetFieldType(strTableName, "Monto")
' boolean
if nType=11 or (nType=131 and Left(GetRequestForm("Monto"),1)="o") then
if GetRequestForm("Monto")="on" then
strValue="1"
else
strValue="0"
end if
else ' not boolean
if GetRequestForm("Monto")="" and ( nType=72 or nType=133 or nType=134 or nType=135 ) then
strValue = NULL
else
strValue=GetRequestForm("Monto")
' date edit convert
if GetEditFormat("Monto")=EDIT_FORMAT_DATE or IsDateFieldType(nType) then
strValue= FormatDbDate(strValue, DateEditType("Monto"))
end if
if IfNeedQuotes(GetFieldType(strTableName, "Monto"))<>"True" or IsDateFieldType(GetFieldType(strTableName, "Monto")) then
if strValue="" then
strValue=Null
end if
end if
if IsFloat(nType) and strValue<>"" then
strValue = Replace(strValue, ",", ".")
end if
end if
end if
if GetEditFormat("Monto")=EDIT_FORMATFILE then
if GetRequestForm("typeMonto") = "upload1" or GetRequestForm("typeMonto") = "upload2" then
If IsNull(strValue) or GetRequestForm("typeMonto") = "upload1" Then
rs("Monto") = Null
DeleteFile Server.MapPath(GetUploadFolder("Monto") & GetRequestForm("filenameMonto"))
Else
rs("Monto")= strValue
if strValue<>"" then
WriteToFile Server.MapPath(GetUploadFolder("Monto") & strValue), GetRequestForm("fileMonto")
End If
end if
elseif GetEditFormat("Monto")<>FORMAT_DATABASE_IMAGE and GetEditFormat("Monto")<>FORMAT_DATABASE_FILE then
rs("Monto") = strValue
else
if GetRequestForm("typeMonto") = "file1" or GetRequestForm("typeMonto") = "file2" then
If IsNull(strValue) or GetRequestForm("typeMonto") = "file1" Then
rs("Monto") = Null
Else
rs("Monto").AppendChunk strValue
End If
end if
end if
end if
if IsUpdatable(rs.Fields("Comprobante")) then
nType = GetFieldType(strTableName, "Comprobante")
' boolean
if nType=11 or (nType=131 and Left(GetRequestForm("Comprobante"),1)="o") then
if GetRequestForm("Comprobante")="on" then
strValue="1"
else
strValue="0"
end if
else ' not boolean
if GetRequestForm("Comprobante")="" and ( nType=72 or nType=133 or nType=134 or nType=135 ) then
strValue = NULL
else
strValue=GetRequestForm("Comprobante")
' date edit convert
if GetEditFormat("Comprobante")=EDIT_FORMAT_DATE or IsDateFieldType(nType) then
strValue= FormatDbDate(strValue, DateEditType("Comprobante"))
end if
if IfNeedQuotes(GetFieldType(strTableName, "Comprobante"))<>"True" or IsDateFieldType(GetFieldType(strTableName, "Comprobante")) then
if strValue="" then
strValue=Null
end if
end if
if IsFloat(nType) and strValue<>"" then
strValue = Replace(strValue, ",", ".")
end if
end if
end if
if GetEditFormat("Comprobante")=EDIT_FORMATFILE then
if GetRequestForm("typeComprobante") = "upload1" or GetRequestForm("typeComprobante") = "upload2" then
If IsNull(strValue) or GetRequestForm("typeComprobante") = "upload1" Then
rs("Comprobante") = Null
DeleteFile Server.MapPath(GetUploadFolder("Comprobante") & GetRequestForm("filenameComprobante"))
Else
rs("Comprobante")= strValue
if strValue<>"" then
WriteToFile Server.MapPath(GetUploadFolder("Comprobante") & strValue), GetRequestForm("fileComprobante")
End If
end if
elseif GetEditFormat("Comprobante")<>FORMAT_DATABASE_IMAGE and GetEditFormat("Comprobante")<>FORMAT_DATABASE_FILE then
rs("Comprobante") = strValue
else
if GetRequestForm("typeComprobante") = "file1" or GetRequestForm("typeComprobante") = "file2" then
If IsNull(strValue) or GetRequestForm("typeComprobante") = "file1" Then
rs("Comprobante") = Null
Else
rs("Comprobante").AppendChunk strValue
End If
end if
end if
end if
if IsUpdatable(rs.Fields("Titular")) then
nType = GetFieldType(strTableName, "Titular")
' boolean
if nType=11 or (nType=131 and Left(GetRequestForm("Titular"),1)="o") then
if GetRequestForm("Titular")="on" then
strValue="1"
else
strValue="0"
end if
else ' not boolean
if GetRequestForm("Titular")="" and ( nType=72 or nType=133 or nType=134 or nType=135 ) then
strValue = NULL
else
strValue=GetRequestForm("Titular")
' date edit convert
if GetEditFormat("Titular")=EDIT_FORMAT_DATE or IsDateFieldType(nType) then
strValue= FormatDbDate(strValue, DateEditType("Titular"))
end if
if IfNeedQuotes(GetFieldType(strTableName, "Titular"))<>"True" or IsDateFieldType(GetFieldType(strTableName, "Titular")) then
if strValue="" then
strValue=Null
end if
end if
if IsFloat(nType) and strValue<>"" then
strValue = Replace(strValue, ",", ".")
end if
end if
end if
if GetEditFormat("Titular")=EDIT_FORMATFILE then
if GetRequestForm("typeTitular") = "upload1" or GetRequestForm("typeTitular") = "upload2" then
If IsNull(strValue) or GetRequestForm("typeTitular") = "upload1" Then
rs("Titular") = Null
DeleteFile Server.MapPath(GetUploadFolder("Titular") & GetRequestForm("filenameTitular"))
Else
rs("Titular")= strValue
if strValue<>"" then
WriteToFile Server.MapPath(GetUploadFolder("Titular") & strValue), GetRequestForm("fileTitular")
End If
end if
elseif GetEditFormat("Titular")<>FORMAT_DATABASE_IMAGE and GetEditFormat("Titular")<>FORMAT_DATABASE_FILE then
rs("Titular") = strValue
else
if GetRequestForm("typeTitular") = "file1" or GetRequestForm("typeTitular") = "file2" then
If IsNull(strValue) or GetRequestForm("typeTitular") = "file1" Then
rs("Titular") = Null
Else
rs("Titular").AppendChunk strValue
End If
end if
end if
end if
if IsUpdatable(rs.Fields("Usuario")) then
nType = GetFieldType(strTableName, "Usuario")
' boolean
if nType=11 or (nType=131 and Left(GetRequestForm("Usuario"),1)="o") then
if GetRequestForm("Usuario")="on" then
strValue="1"
else
strValue="0"
end if
else ' not boolean
if GetRequestForm("Usuario")="" and ( nType=72 or nType=133 or nType=134 or nType=135 ) then
strValue = NULL
else
strValue=GetRequestForm("Usuario")
' date edit convert
if GetEditFormat("Usuario")=EDIT_FORMAT_DATE or IsDateFieldType(nType) then
strValue= FormatDbDate(strValue, DateEditType("Usuario"))
end if
if IfNeedQuotes(GetFieldType(strTableName, "Usuario"))<>"True" or IsDateFieldType(GetFieldType(strTableName, "Usuario")) then
if strValue="" then
strValue=Null
end if
end if
if IsFloat(nType) and strValue<>"" then
strValue = Replace(strValue, ",", ".")
end if
end if
end if
if GetEditFormat("Usuario")=EDIT_FORMATFILE then
if GetRequestForm("typeUsuario") = "upload1" or GetRequestForm("typeUsuario") = "upload2" then
If IsNull(strValue) or GetRequestForm("typeUsuario") = "upload1" Then
rs("Usuario") = Null
DeleteFile Server.MapPath(GetUploadFolder("Usuario") & GetRequestForm("filenameUsuario"))
Else
rs("Usuario")= strValue
if strValue<>"" then
WriteToFile Server.MapPath(GetUploadFolder("Usuario") & strValue), GetRequestForm("fileUsuario")
End If
end if
elseif GetEditFormat("Usuario")<>FORMAT_DATABASE_IMAGE and GetEditFormat("Usuario")<>FORMAT_DATABASE_FILE then
rs("Usuario") = strValue
else
if GetRequestForm("typeUsuario") = "file1" or GetRequestForm("typeUsuario") = "file2" then
If IsNull(strValue) or GetRequestForm("typeUsuario") = "file1" Then
rs("Usuario") = Null
Else
rs("Usuario").AppendChunk strValue
End If
end if
end if
end if
if IsUpdatable(rs.Fields("NumeroContrato")) then
nType = GetFieldType(strTableName, "NumeroContrato")
' boolean
if nType=11 or (nType=131 and Left(GetRequestForm("NumeroContrato"),1)="o") then
if GetRequestForm("NumeroContrato")="on" then
strValue="1"
else
strValue="0"
end if
else ' not boolean
if GetRequestForm("NumeroContrato")="" and ( nType=72 or nType=133 or nType=134 or nType=135 ) then
strValue = NULL
else
strValue=GetRequestForm("NumeroContrato")
' date edit convert
if GetEditFormat("NumeroContrato")=EDIT_FORMAT_DATE or IsDateFieldType(nType) then
strValue= FormatDbDate(strValue, DateEditType("NumeroContrato"))
end if
if IfNeedQuotes(GetFieldType(strTableName, "NumeroContrato"))<>"True" or IsDateFieldType(GetFieldType(strTableName, "NumeroContrato")) then
if strValue="" then
strValue=Null
end if
end if
if IsFloat(nType) and strValue<>"" then
strValue = Replace(strValue, ",", ".")
end if
end if
end if
if GetEditFormat("NumeroContrato")=EDIT_FORMATFILE then
if GetRequestForm("typeNumeroContrato") = "upload1" or GetRequestForm("typeNumeroContrato") = "upload2" then
If IsNull(strValue) or GetRequestForm("typeNumeroContrato") = "upload1" Then
rs("NumeroContrato") = Null
DeleteFile Server.MapPath(GetUploadFolder("NumeroContrato") & GetRequestForm("filenameNumeroContrato"))
Else
rs("NumeroContrato")= strValue
if strValue<>"" then
WriteToFile Server.MapPath(GetUploadFolder("NumeroContrato") & strValue), GetRequestForm("fileNumeroContrato")
End If
end if
elseif GetEditFormat("NumeroContrato")<>FORMAT_DATABASE_IMAGE and GetEditFormat("NumeroContrato")<>FORMAT_DATABASE_FILE then
'<*
>
'Add this routine to verify the data entered by the user on the aux field
LookUpError = ""
if GetRequestForm("NumeroContratoAux")<>"" then
set rsTemp = Server.CreateObject("ADODB.Recordset")
rsTemp.Open "select * from tbContratos where NumeroContrato='" & GetRequestForm("NumeroContratoAux") & "'" , dbConnection
if rsTemp.eof then
LookUpError="Error"
strValue = ""
Else
strValue = GetData(rsTemp.Fields("NumeroContrato"), FORMAT_NONE )
end if
end if
'</*****>
rs("NumeroContrato") = strValue
else
if GetRequestForm("typeNumeroContrato") = "file1" or GetRequestForm("typeNumeroContrato") = "file2" then
If IsNull(strValue) or GetRequestForm("typeNumeroContrato") = "file1" Then
rs("NumeroContrato") = Null
Else
rs("NumeroContrato").AppendChunk strValue
End If
end if
end if
end if
if IsUpdatable(rs.Fields("MetodoPago")) then
nType = GetFieldType(strTableName, "MetodoPago")
' boolean
if nType=11 or (nType=131 and Left(GetRequestForm("MetodoPago"),1)="o") then
if GetRequestForm("MetodoPago")="on" then
strValue="1"
else
strValue="0"
end if
else ' not boolean
if GetRequestForm("MetodoPago")="" and ( nType=72 or nType=133 or nType=134 or nType=135 ) then
strValue = NULL
else
strValue=GetRequestForm("MetodoPago")
' date edit convert
if GetEditFormat("MetodoPago")=EDIT_FORMAT_DATE or IsDateFieldType(nType) then
strValue= FormatDbDate(strValue, DateEditType("MetodoPago"))
end if
if IfNeedQuotes(GetFieldType(strTableName, "MetodoPago"))<>"True" or IsDateFieldType(GetFieldType(strTableName, "MetodoPago")) then
if strValue="" then
strValue=Null
end if
end if
if IsFloat(nType) and strValue<>"" then
strValue = Replace(strValue, ",", ".")
end if
end if
end if
if GetEditFormat("MetodoPago")=EDIT_FORMATFILE then
if GetRequestForm("typeMetodoPago") = "upload1" or GetRequestForm("typeMetodoPago") = "upload2" then
If IsNull(strValue) or GetRequestForm("typeMetodoPago") = "upload1" Then
rs("MetodoPago") = Null
DeleteFile Server.MapPath(GetUploadFolder("MetodoPago") & GetRequestForm("filenameMetodoPago"))
Else
rs("MetodoPago")= strValue
if strValue<>"" then
WriteToFile Server.MapPath(GetUploadFolder("MetodoPago") & strValue), GetRequestForm("fileMetodoPago")
End If
end if
elseif GetEditFormat("MetodoPago")<>FORMAT_DATABASE_IMAGE and GetEditFormat("MetodoPago")<>FORMAT_DATABASE_FILE then
rs("MetodoPago") = strValue
else
if GetRequestForm("typeMetodoPago") = "file1" or GetRequestForm("typeMetodoPago") = "file2" then
If IsNull(strValue) or GetRequestForm("typeMetodoPago") = "file1" Then
rs("MetodoPago") = Null
Else
rs("MetodoPago").AppendChunk strValue
End If
end if
end if
end if
if IsUpdatable(rs.Fields("TipoPago")) then
nType = GetFieldType(strTableName, "TipoPago")
' boolean
if nType=11 or (nType=131 and Left(GetRequestForm("TipoPago"),1)="o") then
if GetRequestForm("TipoPago")="on" then
strValue="1"
else
strValue="0"
end if
else ' not boolean
if GetRequestForm("TipoPago")="" and ( nType=72 or nType=133 or nType=134 or nType=135 ) then
strValue = NULL
else
strValue=GetRequestForm("TipoPago")
' date edit convert
if GetEditFormat("TipoPago")=EDIT_FORMAT_DATE or IsDateFieldType(nType) then
strValue= FormatDbDate(strValue, DateEditType("TipoPago"))
end if
if IfNeedQuotes(GetFieldType(strTableName, "TipoPago"))<>"True" or IsDateFieldType(GetFieldType(strTableName, "TipoPago")) then
if strValue="" then
strValue=Null
end if
end if
if IsFloat(nType) and strValue<>"" then
strValue = Replace(strValue, ",", ".")
end if
end if
end if
if GetEditFormat("TipoPago")=EDIT_FORMATFILE then
if GetRequestForm("typeTipoPago") = "upload1" or GetRequestForm("typeTipoPago") = "upload2" then
If IsNull(strValue) or GetRequestForm("typeTipoPago") = "upload1" Then
rs("TipoPago") = Null
DeleteFile Server.MapPath(GetUploadFolder("TipoPago") & GetRequestForm("filenameTipoPago"))
Else
rs("TipoPago")= strValue
if strValue<>"" then
WriteToFile Server.MapPath(GetUploadFolder("TipoPago") & strValue), GetRequestForm("fileTipoPago")
End If
end if
elseif GetEditFormat("TipoPago")<>FORMAT_DATABASE_IMAGE and GetEditFormat("TipoPago")<>FORMAT_DATABASE_FILE then
rs("TipoPago") = strValue
else
if GetRequestForm("typeTipoPago") = "file1" or GetRequestForm("typeTipoPago") = "file2" then
If IsNull(strValue) or GetRequestForm("typeTipoPago") = "file1" Then
rs("TipoPago") = Null
Else
rs("TipoPago").AppendChunk strValue
End If
end if
end if
end if
if IsUpdatable(rs.Fields("InstitucionPago")) then
nType = GetFieldType(strTableName, "InstitucionPago")
' boolean
if nType=11 or (nType=131 and Left(GetRequestForm("InstitucionPago"),1)="o") then
if GetRequestForm("InstitucionPago")="on" then
strValue="1"
else
strValue="0"
end if
else ' not boolean
if GetRequestForm("InstitucionPago")="" and ( nType=72 or nType=133 or nType=134 or nType=135 ) then
strValue = NULL
else
strValue=GetRequestForm("InstitucionPago")
' date edit convert
if GetEditFormat("InstitucionPago")=EDIT_FORMAT_DATE or IsDateFieldType(nType) then
strValue= FormatDbDate(strValue, DateEditType("InstitucionPago"))
end if
if IfNeedQuotes(GetFieldType(strTableName, "InstitucionPago"))<>"True" or IsDateFieldType(GetFieldType(strTableName, "InstitucionPago")) then
if strValue="" then
strValue=Null
end if
end if
if IsFloat(nType) and strValue<>"" then
strValue = Replace(strValue, ",", ".")
end if
end if
end if
if GetEditFormat("InstitucionPago")=EDIT_FORMATFILE then
if GetRequestForm("typeInstitucionPago") = "upload1" or GetRequestForm("typeInstitucionPago") = "upload2" then
If IsNull(strValue) or GetRequestForm("typeInstitucionPago") = "upload1" Then
rs("InstitucionPago") = Null
DeleteFile Server.MapPath(GetUploadFolder("InstitucionPago") & GetRequestForm("filenameInstitucionPago"))
Else
rs("InstitucionPago")= strValue
if strValue<>"" then
WriteToFile Server.MapPath(GetUploadFolder("InstitucionPago") & strValue), GetRequestForm("fileInstitucionPago")
End If
end if
elseif GetEditFormat("InstitucionPago")<>FORMAT_DATABASE_IMAGE and GetEditFormat("InstitucionPago")<>FORMAT_DATABASE_FILE then
rs("InstitucionPago") = strValue
else
if GetRequestForm("typeInstitucionPago") = "file1" or GetRequestForm("typeInstitucionPago") = "file2" then
If IsNull(strValue) or GetRequestForm("typeInstitucionPago") = "file1" Then
rs("InstitucionPago") = Null
Else
rs("InstitucionPago").AppendChunk strValue
End If
end if
end if
end if
if IsUpdatable(rs.Fields("Numero")) then
nType = GetFieldType(strTableName, "Numero")
' boolean
if nType=11 or (nType=131 and Left(GetRequestForm("Numero"),1)="o") then
if GetRequestForm("Numero")="on" then
strValue="1"
else
strValue="0"
end if
else ' not boolean
if GetRequestForm("Numero")="" and ( nType=72 or nType=133 or nType=134 or nType=135 ) then
strValue = NULL
else
strValue=GetRequestForm("Numero")
' date edit convert
if GetEditFormat("Numero")=EDIT_FORMAT_DATE or IsDateFieldType(nType) then
strValue= FormatDbDate(strValue, DateEditType("Numero"))
end if
if IfNeedQuotes(GetFieldType(strTableName, "Numero"))<>"True" or IsDateFieldType(GetFieldType(strTableName, "Numero")) then
if strValue="" then
strValue=Null
end if
end if
if IsFloat(nType) and strValue<>"" then
strValue = Replace(strValue, ",", ".")
end if
end if
end if
if GetEditFormat("Numero")=EDIT_FORMATFILE then
if GetRequestForm("typeNumero") = "upload1" or GetRequestForm("typeNumero") = "upload2" then
If IsNull(strValue) or GetRequestForm("typeNumero") = "upload1" Then
rs("Numero") = Null
DeleteFile Server.MapPath(GetUploadFolder("Numero") & GetRequestForm("filenameNumero"))
Else
rs("Numero")= strValue
if strValue<>"" then
WriteToFile Server.MapPath(GetUploadFolder("Numero") & strValue), GetRequestForm("fileNumero")
End If
end if
elseif GetEditFormat("Numero")<>FORMAT_DATABASE_IMAGE and GetEditFormat("Numero")<>FORMAT_DATABASE_FILE then
rs("Numero") = strValue
else
if GetRequestForm("typeNumero") = "file1" or GetRequestForm("typeNumero") = "file2" then
If IsNull(strValue) or GetRequestForm("typeNumero") = "file1" Then
rs("Numero") = Null
Else
rs("Numero").AppendChunk strValue
End If
end if
end if
end if
if IsUpdatable(rs.Fields("Status")) then
nType = GetFieldType(strTableName, "Status")
' boolean
if nType=11 or (nType=131 and Left(GetRequestForm("Status"),1)="o") then
if GetRequestForm("Status")="on" then
strValue="1"
else
strValue="0"
end if
else ' not boolean
if GetRequestForm("Status")="" and ( nType=72 or nType=133 or nType=134 or nType=135 ) then
strValue = NULL
else
strValue=GetRequestForm("Status")
' date edit convert
if GetEditFormat("Status")=EDIT_FORMAT_DATE or IsDateFieldType(nType) then
strValue= FormatDbDate(strValue, DateEditType("Status"))
end if
if IfNeedQuotes(GetFieldType(strTableName, "Status"))<>"True" or IsDateFieldType(GetFieldType(strTableName, "Status")) then
if strValue="" then
strValue=Null
end if
end if
if IsFloat(nType) and strValue<>"" then
strValue = Replace(strValue, ",", ".")
end if
end if
end if
if GetEditFormat("Status")=EDIT_FORMATFILE then
if GetRequestForm("typeStatus") = "upload1" or GetRequestForm("typeStatus") = "upload2" then
If IsNull(strValue) or GetRequestForm("typeStatus") = "upload1" Then
rs("Status") = Null
DeleteFile Server.MapPath(GetUploadFolder("Status") & GetRequestForm("filenameStatus"))
Else
rs("Status")= strValue
if strValue<>"" then
WriteToFile Server.MapPath(GetUploadFolder("Status") & strValue), GetRequestForm("fileStatus")
End If
end if
elseif GetEditFormat("Status")<>FORMAT_DATABASE_IMAGE and GetEditFormat("Status")<>FORMAT_DATABASE_FILE then
rs("Status") = strValue
else
if GetRequestForm("typeStatus") = "file1" or GetRequestForm("typeStatus") = "file2" then
If IsNull(strValue) or GetRequestForm("typeStatus") = "file1" Then
rs("Status") = Null
Else
rs("Status").AppendChunk strValue
End If
end if
end if
end if
if IsUpdatable(rs.Fields("Notas")) then
nType = GetFieldType(strTableName, "Notas")
' boolean
if nType=11 or (nType=131 and Left(GetRequestForm("Notas"),1)="o") then
if GetRequestForm("Notas")="on" then
strValue="1"
else
strValue="0"
end if
else ' not boolean
if GetRequestForm("Notas")="" and ( nType=72 or nType=133 or nType=134 or nType=135 ) then
strValue = NULL
else
strValue=GetRequestForm("Notas")
' date edit convert
if GetEditFormat("Notas")=EDIT_FORMAT_DATE or IsDateFieldType(nType) then
strValue= FormatDbDate(strValue, DateEditType("Notas"))
end if
if IfNeedQuotes(GetFieldType(strTableName, "Notas"))<>"True" or IsDateFieldType(GetFieldType(strTableName, "Notas")) then
if strValue="" then
strValue=Null
end if
end if
if IsFloat(nType) and strValue<>"" then
strValue = Replace(strValue, ",", ".")
end if
end if
end if
if GetEditFormat("Notas")=EDIT_FORMATFILE then
if GetRequestForm("typeNotas") = "upload1" or GetRequestForm("typeNotas") = "upload2" then
If IsNull(strValue) or GetRequestForm("typeNotas") = "upload1" Then
rs("Notas") = Null
DeleteFile Server.MapPath(GetUploadFolder("Notas") & GetRequestForm("filenameNotas"))
Else
rs("Notas")= strValue
if strValue<>"" then
WriteToFile Server.MapPath(GetUploadFolder("Notas") & strValue), GetRequestForm("fileNotas")
End If
end if
elseif GetEditFormat("Notas")<>FORMAT_DATABASE_IMAGE and GetEditFormat("Notas")<>FORMAT_DATABASE_FILE then
rs("Notas") = strValue
else
if GetRequestForm("typeNotas") = "file1" or GetRequestForm("typeNotas") = "file2" then
If IsNull(strValue) or GetRequestForm("typeNotas") = "file1" Then
rs("Notas") = Null
Else
rs("Notas").AppendChunk strValue
End If
end if
end if
end if
'<*
>
'Add this lines to update only if the aux fiels are empty or with a valid value
If LookUpError = "" then
'</****>
rs.Update
rs.Close
'<
>
'Add this lines to update only if the aux fiels are empty or with a valid value
End If
'</****>
end if
'<
>
'Add this lines to update only if the aux fiels are empty or with a valid value
If LookUpError = "" then
'</****>
Call ReportError
message="<div class=message><<< " & "Record updated" & " >>></div>"
'<
>
'Add this lines to Show the error dialog box if aux fields are incorrect
Else
Response.Write "<script language=""JavaScript"">"
Response.Write "var WrongFileValue = """";"
Response.Write "WrongFileValue += ""NumeroContrato\n"";"
Response.Write "alert( ""ERROR EN INGRESO: \r\n\r\n""+ WrongFileValue + ""\r\n\r\n"" );"
Response.Write "</script>"
message="<div class=message><<< " & "ERROR EN INGRESO" & " >>></div>"
End If
'</****>
end if
sMode = "Edit"
Response.Write "<h1>Pagos Recibidos Detalle, " & "Edit record" & " [" & strKeyField & ": " & GetRequestForm("editid")
if strKeyField2<>"" then Response.Write ", " & strKeyField2 & ": " & GetRequestForm("editid2") end if
if strKeyField3<>"" then Response.Write ", " & strKeyField3 & ": " & GetRequestForm("editid3") end if
Response.Write "]</h1>"
response.write message
response.write "<div align=left><hr width=300 noshade size=1></div>"
'<
>
'Add this lines to proced only if the aux fiels are empty or with a valid value
If LookUpError = "" then
'</****>
LogInfo(strSQL)
rs.open strSQL, dbConnection
Call ReportError
'<
**>
'Add this lines to proced only if the aux fiels are empty or with a valid value
End If
'</***>
' "back to list" link
if Session(strTableName & "_ListURL")="" or right(Session(strTableName & "_ListURL"),1)="?" then
sHref = "tbDepositosDetalle_list.asp?action=backtolist"
else
sHref = Session(strTableName & "_ListURL")
end if
Response.write "Â Â Â <a href=""" & sHref & """>" & "Back to list" & "</a>
"
Response.Write "<table cellpadding=2>"
%>
<form name="editform" method="POST" enctype="multipart/form-data" action=tbDepositosDetalle_edit.asp onSubmit=" return validate();"">
<input type=hidden name=editid value="<%=HTMLEncode(GetRequestForm("editid"))%>">
<input type=hidden name=editid2 value="<%=HTMLEncode(GetRequestForm("editid2"))%>">
<input type=hidden name=editid3 value="<%=HTMLEncode(GetRequestForm("editid3"))%>">
<input type=hidden id=masterkey name=masterkey value="<%=GetRequestForm("masterkey")%>">
<%
strPK = AddWrappers(strKeyField)
if strKeyField2<>"" then strPK = strPK & "," & AddWrappers(strKeyField2)
if strKeyField3<>"" then strPK = strPK & "," & AddWrappers(strKeyField3)
sFieldName = "NumeroDeposito"
if rs.EOF and rs.BOF then
strValue=""
else
strValue = GetData(rs.Fields(sFieldName), FORMAT_NONE )
end if
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
Response.Write vbCRLF & "<tr><td class=shade>"
Response.Write Label(sFieldName) & " "
Response.Write "</td><td>"
end if
bUpdatable = IsUpdatable(rs.Fields(sFieldName))
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
if Format(rs.Fields(sFieldName).Name) <> FORMAT_HTML then
strEncoded = HTMLEncode(strValue)
else
strEncoded = strValue
end if
if bUpdatable or IsBinaryField(rs.Fields(sFieldName)) or Format(rs.Fields(sFieldName).Name)=FORMAT_DATABASE_FILE then
sFormat = GetEditFormat(sFieldName)
Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, sFormat, sMode)
else
strEncoded = GetData(rs.Fields(sFieldName), Format(rs.Fields(sFieldName).Name))
Response.Write Replace(strEncoded, vbcrlf, "
")
end if
' add icons if required
Response.Write GetLegendIcon(sFieldName, nType, i)
Response.Write "</td></tr>"
else
Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, GetEditFormat(sFieldName), sMode)
end if
sFieldName = "NumeroDepositoDetalle"
if rs.EOF and rs.BOF then
strValue=""
else
strValue = GetData(rs.Fields(sFieldName), FORMAT_NONE )
end if
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
Response.Write vbCRLF & "<tr><td class=shade>"
Response.Write Label(sFieldName) & " "
Response.Write "</td><td>"
end if
bUpdatable = IsUpdatable(rs.Fields(sFieldName))
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
if Format(rs.Fields(sFieldName).Name) <> FORMAT_HTML then
strEncoded = HTMLEncode(strValue)
else
strEncoded = strValue
end if
if bUpdatable or IsBinaryField(rs.Fields(sFieldName)) or Format(rs.Fields(sFieldName).Name)=FORMAT_DATABASE_FILE then
sFormat = GetEditFormat(sFieldName)
Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, sFormat, sMode)
else
strEncoded = GetData(rs.Fields(sFieldName), Format(rs.Fields(sFieldName).Name))
Response.Write Replace(strEncoded, vbcrlf, "
")
end if
' add icons if required
Response.Write GetLegendIcon(sFieldName, nType, i)
Response.Write "</td></tr>"
else
Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, GetEditFormat(sFieldName), sMode)
end if
sFieldName = "CheckNumber"
if rs.EOF and rs.BOF then
strValue=""
else
strValue = GetData(rs.Fields(sFieldName), FORMAT_NONE )
end if
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
Response.Write vbCRLF & "<tr><td class=shade>"
Response.Write Label(sFieldName) & " "
Response.Write "</td><td>"
end if
bUpdatable = IsUpdatable(rs.Fields(sFieldName))
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
if Format(rs.Fields(sFieldName).Name) <> FORMAT_HTML then
strEncoded = HTMLEncode(strValue)
else
strEncoded = strValue
end if
if bUpdatable or IsBinaryField(rs.Fields(sFieldName)) or Format(rs.Fields(sFieldName).Name)=FORMAT_DATABASE_FILE then
sFormat = GetEditFormat(sFieldName)
Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, sFormat, sMode)
else
strEncoded = GetData(rs.Fields(sFieldName), Format(rs.Fields(sFieldName).Name))
Response.Write Replace(strEncoded, vbcrlf, "
")
end if
' add icons if required
Response.Write GetLegendIcon(sFieldName, nType, i)
Response.Write "</td></tr>"
else
Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, GetEditFormat(sFieldName), sMode)
end if
sFieldName = "Monto"
if rs.EOF and rs.BOF then
strValue=""
else
strValue = GetData(rs.Fields(sFieldName), FORMAT_NONE )
end if
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
Response.Write vbCRLF & "<tr><td class=shade>"
Response.Write Label(sFieldName) & " "
Response.Write "</td><td>"
end if
bUpdatable = IsUpdatable(rs.Fields(sFieldName))
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
if Format(rs.Fields(sFieldName).Name) <> FORMAT_HTML then
strEncoded = HTMLEncode(strValue)
else
strEncoded = strValue
end if
if bUpdatable or IsBinaryField(rs.Fields(sFieldName)) or Format(rs.Fields(sFieldName).Name)=FORMAT_DATABASE_FILE then
sFormat = GetEditFormat(sFieldName)
Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, sFormat, sMode)
else
strEncoded = GetData(rs.Fields(sFieldName), Format(rs.Fields(sFieldName).Name))
Response.Write Replace(strEncoded, vbcrlf, "
")
end if
' add icons if required
Response.Write GetLegendIcon(sFieldName, nType, i)
Response.Write "</td></tr>"
else
Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, GetEditFormat(sFieldName), sMode)
end if
sFieldName = "Comprobante"
if rs.EOF and rs.BOF then
strValue=""
else
strValue = GetData(rs.Fields(sFieldName), FORMAT_NONE )
end if
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
Response.Write vbCRLF & "<tr><td class=shade>"
Response.Write Label(sFieldName) & " "
Response.Write "</td><td>"
end if
bUpdatable = IsUpdatable(rs.Fields(sFieldName))
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
if Format(rs.Fields(sFieldName).Name) <> FORMAT_HTML then
strEncoded = HTMLEncode(strValue)
else
strEncoded = strValue
end if
if bUpdatable or IsBinaryField(rs.Fields(sFieldName)) or Format(rs.Fields(sFieldName).Name)=FORMAT_DATABASE_FILE then
sFormat = GetEditFormat(sFieldName)
Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, sFormat, sMode)
else
strEncoded = GetData(rs.Fields(sFieldName), Format(rs.Fields(sFieldName).Name))
Response.Write Replace(strEncoded, vbcrlf, "
")
end if
' add icons if required
Response.Write GetLegendIcon(sFieldName, nType, i)
Response.Write "</td></tr>"
else
Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, GetEditFormat(sFieldName), sMode)
end if
sFieldName = "Titular"
if rs.EOF and rs.BOF then
strValue=""
else
strValue = GetData(rs.Fields(sFieldName), FORMAT_NONE )
end if
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
Response.Write vbCRLF & "<tr><td class=shade>"
Response.Write Label(sFieldName) & " "
Response.Write "</td><td>"
end if
bUpdatable = IsUpdatable(rs.Fields(sFieldName))
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
if Format(rs.Fields(sFieldName).Name) <> FORMAT_HTML then
strEncoded = HTMLEncode(strValue)
else
strEncoded = strValue
end if
if bUpdatable or IsBinaryField(rs.Fields(sFieldName)) or Format(rs.Fields(sFieldName).Name)=FORMAT_DATABASE_FILE then
sFormat = GetEditFormat(sFieldName)
Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, sFormat, sMode)
else
strEncoded = GetData(rs.Fields(sFieldName), Format(rs.Fields(sFieldName).Name))
Response.Write Replace(strEncoded, vbcrlf, "
")
end if
' add icons if required
Response.Write GetLegendIcon(sFieldName, nType, i)
Response.Write "</td></tr>"
else
Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, GetEditFormat(sFieldName), sMode)
end if
sFieldName = "Usuario"
if rs.EOF and rs.BOF then
strValue=""
else
strValue = GetData(rs.Fields(sFieldName), FORMAT_NONE )
end if
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
Response.Write vbCRLF & "<tr><td class=shade>"
Response.Write Label(sFieldName) & " "
Response.Write "</td><td>"
end if
bUpdatable = IsUpdatable(rs.Fields(sFieldName))
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
if Format(rs.Fields(sFieldName).Name) <> FORMAT_HTML then
strEncoded = HTMLEncode(strValue)
else
strEncoded = strValue
end if
if bUpdatable or IsBinaryField(rs.Fields(sFieldName)) or Format(rs.Fields(sFieldName).Name)=FORMAT_DATABASE_FILE then
sFormat = GetEditFormat(sFieldName)
Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, sFormat, sMode)
else
strEncoded = GetData(rs.Fields(sFieldName), Format(rs.Fields(sFieldName).Name))
Response.Write Replace(strEncoded, vbcrlf, "
")
end if
' add icons if required
Response.Write GetLegendIcon(sFieldName, nType, i)
Response.Write "</td></tr>"
else
Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, GetEditFormat(sFieldName), sMode)
end if
sFieldName = "NumeroContrato"
if rs.EOF and rs.BOF then
strValue=""
else
strValue = GetData(rs.Fields(sFieldName), FORMAT_NONE )
end if
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
Response.Write vbCRLF & "<tr><td class=shade>"
Response.Write Label(sFieldName) & " "
Response.Write "</td><td>"
end if
bUpdatable = IsUpdatable(rs.Fields(sFieldName))
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
if Format(rs.Fields(sFieldName).Name) <> FORMAT_HTML then
strEncoded = HTMLEncode(strValue)
else
strEncoded = strValue
end if
if bUpdatable or IsBinaryField(rs.Fields(sFieldName)) or Format(rs.Fields(sFieldName).Name)=FORMAT_DATABASE_FILE then
sFormat = GetEditFormat(sFieldName)
Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, sFormat, sMode)
else
strEncoded = GetData(rs.Fields(sFieldName), Format(rs.Fields(sFieldName).Name))
Response.Write Replace(strEncoded, vbcrlf, "
")
end if
'<
>
'Add this line to include a new aux field
Response.Write "<input type=text name=NumeroContratoAux>"
'</>
' add icons if required
Response.Write GetLegendIcon(sFieldName, nType, i)
Response.Write "</td></tr>"
else
Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, GetEditFormat(sFieldName), sMode)
end if
sFieldName = "MetodoPago"
if rs.EOF and rs.BOF then
strValue=""
else
strValue = GetData(rs.Fields(sFieldName), FORMAT_NONE )
end if
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
Response.Write vbCRLF & "<tr><td class=shade>"
Response.Write Label(sFieldName) & " "
Response.Write "</td><td>"
end if
bUpdatable = IsUpdatable(rs.Fields(sFieldName))
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
if Format(rs.Fields(sFieldName).Name) <> FORMAT_HTML then
strEncoded = HTMLEncode(strValue)
else
strEncoded = strValue
end if
if bUpdatable or IsBinaryField(rs.Fields(sFieldName)) or Format(rs.Fields(sFieldName).Name)=FORMAT_DATABASE_FILE then
sFormat = GetEditFormat(sFieldName)
Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, sFormat, sMode)
else
strEncoded = GetData(rs.Fields(sFieldName), Format(rs.Fields(sFieldName).Name))
Response.Write Replace(strEncoded, vbcrlf, "
")
end if
' add icons if required
Response.Write GetLegendIcon(sFieldName, nType, i)
Response.Write "</td></tr>"
else
Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, GetEditFormat(sFieldName), sMode)
end if
sFieldName = "TipoPago"
if rs.EOF and rs.BOF then
strValue=""
else
strValue = GetData(rs.Fields(sFieldName), FORMAT_NONE )
end if
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
Response.Write vbCRLF & "<tr><td class=shade>"
Response.Write Label(sFieldName) & " "
Response.Write "</td><td>"
end if
bUpdatable = IsUpdatable(rs.Fields(sFieldName))
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
if Format(rs.Fields(sFieldName).Name) <> FORMAT_HTML then
strEncoded = HTMLEncode(strValue)
else
strEncoded = strValue
end if
if bUpdatable or IsBinaryField(rs.Fields(sFieldName)) or Format(rs.Fields(sFieldName).Name)=FORMAT_DATABASE_FILE then
sFormat = GetEditFormat(sFieldName)
Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, sFormat, sMode)
else
strEncoded = GetData(rs.Fields(sFieldName), Format(rs.Fields(sFieldName).Name))
Response.Write Replace(strEncoded, vbcrlf, "
")
end if
' add icons if required
Response.Write GetLegendIcon(sFieldName, nType, i)
Response.Write "</td></tr>"
else
Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, GetEditFormat(sFieldName), sMode)
end if
sFieldName = "InstitucionPago"
if rs.EOF and rs.BOF then
strValue=""
else
strValue = GetData(rs.Fields(sFieldName), FORMAT_NONE )
end if
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
Response.Write vbCRLF & "<tr><td class=shade>"
Response.Write Label(sFieldName) & " "
Response.Write "</td><td>"
end if
bUpdatable = IsUpdatable(rs.Fields(sFieldName))
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
if Format(rs.Fields(sFieldName).Name) <> FORMAT_HTML then
strEncoded = HTMLEncode(strValue)
else
strEncoded = strValue
end if
if bUpdatable or IsBinaryField(rs.Fields(sFieldName)) or Format(rs.Fields(sFieldName).Name)=FORMAT_DATABASE_FILE then
sFormat = GetEditFormat(sFieldName)
Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, sFormat, sMode)
else
strEncoded = GetData(rs.Fields(sFieldName), Format(rs.Fields(sFieldName).Name))
Response.Write Replace(strEncoded, vbcrlf, "
")
end if
' add icons if required
Response.Write GetLegendIcon(sFieldName, nType, i)
Response.Write "</td></tr>"
else
Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, GetEditFormat(sFieldName), sMode)
end if
sFieldName = "Numero"
if rs.EOF and rs.BOF then
strValue=""
else
strValue = GetData(rs.Fields(sFieldName), FORMAT_NONE )
end if
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
Response.Write vbCRLF & "<tr><td class=shade>"
Response.Write Label(sFieldName) & " "
Response.Write "</td><td>"
end if
bUpdatable = IsUpdatable(rs.Fields(sFieldName))
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
if Format(rs.Fields(sFieldName).Name) <> FORMAT_HTML then
strEncoded = HTMLEncode(strValue)
else
strEncoded = strValue
end if
if bUpdatable or IsBinaryField(rs.Fields(sFieldName)) or Format(rs.Fields(sFieldName).Name)=FORMAT_DATABASE_FILE then
sFormat = GetEditFormat(sFieldName)
Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, sFormat, sMode)
else
strEncoded = GetData(rs.Fields(sFieldName), Format(rs.Fields(sFieldName).Name))
Response.Write Replace(strEncoded, vbcrlf, "
")
end if
' add icons if required
Response.Write GetLegendIcon(sFieldName, nType, i)
Response.Write "</td></tr>"
else
Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, GetEditFormat(sFieldName), sMode)
end if
sFieldName = "Status"
if rs.EOF and rs.BOF then
strValue=""
else
strValue = GetData(rs.Fields(sFieldName), FORMAT_NONE )
end if
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
Response.Write vbCRLF & "<tr><td class=shade>"
Response.Write Label(sFieldName) & " "
Response.Write "</td><td>"
end if
bUpdatable = IsUpdatable(rs.Fields(sFieldName))
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
if Format(rs.Fields(sFieldName).Name) <> FORMAT_HTML then
strEncoded = HTMLEncode(strValue)
else
strEncoded = strValue
end if
if bUpdatable or IsBinaryField(rs.Fields(sFieldName)) or Format(rs.Fields(sFieldName).Name)=FORMAT_DATABASE_FILE then
sFormat = GetEditFormat(sFieldName)
Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, sFormat, sMode)
else
strEncoded = GetData(rs.Fields(sFieldName), Format(rs.Fields(sFieldName).Name))
Response.Write Replace(strEncoded, vbcrlf, "
")
end if
' add icons if required
Response.Write GetLegendIcon(sFieldName, nType, i)
Response.Write "</td></tr>"
else
Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, GetEditFormat(sFieldName), sMode)
end if
sFieldName = "Notas"
if rs.EOF and rs.BOF then
strValue=""<b