Los Foros de ASPTutor.com
Home | Perfil | Registrarse | Temas Activos | Miembros | Buscar | FAQ
Usuario:
Password:
 Todos los Foros
 ASP
 editar registro
 Foro Bloqueado  Tema Bloqueado


Autor Temas
rbustamante
Starting Member


6 Posts
Mensajes - 18 Apr 2007 :  15:47:48  Ver Perfil  Enviar Email
Hola a todos, tengo el siguiente problema, estoy editando un registro ocupando el dremweaver y Access y al momento de editar me sale el siguiente error:

Microsoft JET Database Engine (0x80040E07)
No coinciden los tipos de datos en la expresión de criterios.
/editar_socio.asp, línea 111

y me marca el error en la linea donde tengo la siguiente intruccion MM_editCmd.Execute

aqui esta el codigo completo

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/con_bienestar.asp" -->
<%
' *** Edit Operations: declare variables

Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd

Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId

Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i

MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
End If

' boolean to abort record edit
MM_abortEdit = false

' query string to execute
MM_editQuery = ""
%>
<%
' *** Update Record: set variables

If (CStr(Request("MM_update")) = "form1" And CStr(Request("MM_recordId")) <> "") Then

MM_editConnection = MM_con_bienestar_STRING
MM_editTable = "Socios"
MM_editColumn = "Id_socios"
MM_recordId = "'" + Request.Form("MM_recordId") + "'"
MM_editRedirectUrl = "resultado_rut.asp"
MM_fieldsStr = "rut|value|nombre_socio|value|ap_paterno|value|ap_materno|value|tel_particular|value|tel_laboral|value|celular|value|email|value|direccion|value|comuna|value|cargo|value|area|value|fecha_ingreso|value|n_cargas|value|renta_mensual|value|tipo_socio|value|disponible_reembolso|value|disponible_convenio|value|estado_de_usuario|value"
MM_columnsStr = "rut|',none,''|nombre_socio|',none,''|ap_paterno|',none,''|ap_materno|',none,''|tel_particular|',none,''|tel_laboral|',none,''|celular|',none,''|email|',none,''|direccion|',none,''|comuna|',none,''|cargo|',none,''|area|',none,''|fecha_ingreso|',none,''|n_cargas|',none,''|renta_mensual|',none,''|tipo_socio|',none,''|disponible_reembolso|',none,''|disponible_convenio|',none,''|estado_de_usuario|',none,''"

' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|")
MM_columns = Split(MM_columnsStr, "|")

' set the form values
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))
Next

' append the query string to the redirect URL
If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If

End If
%>
<%
' *** Update Record: construct a sql update statement and execute it

If (CStr(Request("MM_update")) <> "" And CStr(Request("MM_recordId")) <> "") Then

' create the sql update statement
MM_editQuery = "update " & MM_editTable & " set "
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_formVal = MM_fields(MM_i+1)
MM_typeArray = Split(MM_columns(MM_i+1),",")
MM_delim = MM_typeArray(0)
If (MM_delim = "none") Then MM_delim = ""
MM_altVal = MM_typeArray(1)
If (MM_altVal = "none") Then MM_altVal = ""
MM_emptyVal = MM_typeArray(2)
If (MM_emptyVal = "none") Then MM_emptyVal = ""
If (MM_formVal = "") Then
MM_formVal = MM_emptyVal
Else
If (MM_altVal <> "") Then
MM_formVal = MM_altVal
ElseIf (MM_delim = "'") Then ' escape quotes
MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"
Else
MM_formVal = MM_delim + MM_formVal + MM_delim
End If
End If
If (MM_i <> LBound(MM_fields)) Then
MM_editQuery = MM_editQuery & ","
End If
MM_editQuery = MM_editQuery & MM_columns(MM_i) & " = " & MM_formVal
Next
MM_editQuery = MM_editQuery & " where " & MM_editColumn & " = " & MM_recordId

If (Not MM_abortEdit) Then
' execute the update
Set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close

If (MM_editRedirectUrl <> "") Then
Response.Redirect(MM_editRedirectUrl)
End If
End If

End If
%>
<%
Dim editar_socio__MMColParam
editar_socio__MMColParam = "Id_socios"
If (Request("MM_EmptyValue") <> "") Then
editar_socio__MMColParam = Request("MM_EmptyValue")
End If
%>
<%
Dim editar_socio
Dim editar_socio_numRows

Set editar_socio = Server.CreateObject("ADODB.Recordset")
editar_socio.ActiveConnection = MM_con_bienestar_STRING
editar_socio.Source = "SELECT * FROM Socios WHERE Id_socios = " + Replace(editar_socio__MMColParam, "'", "''") + ""
editar_socio.CursorType = 0
editar_socio.CursorLocation = 2
editar_socio.LockType = 1
editar_socio.Open()

editar_socio_numRows = 0
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
</head>

<body>
<form method="POST" action="<%=MM_editAction%>" name="form1">
<table align="center">
<tr valign="baseline">
<td nowrap align="right"><div align="left">Rut:</div></td>
<td><input type="text" name="rut" value="<%=(editar_socio.Fields.Item("rut").Value)%>" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right"><div align="left">Nombre_socio:</div></td>
<td><input type="text" name="nombre_socio" value="<%=(editar_socio.Fields.Item("nombre_socio").Value)%>" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right"><div align="left">Ap_paterno:</div></td>
<td><input type="text" name="ap_paterno" value="<%=(editar_socio.Fields.Item("ap_paterno").Value)%>" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right"><div align="left">Ap_materno:</div></td>
<td><input type="text" name="ap_materno" value="<%=(editar_socio.Fields.Item("ap_materno").Value)%>" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right"><div align="left">Tel_particular:</div></td>
<td><input type="text" name="tel_particular" value="<%=(editar_socio.Fields.Item("tel_particular").Value)%>" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right"><div align="left">Tel_laboral:</div></td>
<td><input type="text" name="tel_laboral" value="<%=(editar_socio.Fields.Item("tel_laboral").Value)%>" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right"><div align="left">Celular:</div></td>
<td><input type="text" name="celular" value="<%=(editar_socio.Fields.Item("celular").Value)%>" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right"><div align="left">Email:</div></td>
<td><input type="text" name="email" value="<%=(editar_socio.Fields.Item("email").Value)%>" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right"><div align="left">Direccion:</div></td>
<td><input type="text" name="direccion" value="<%=(editar_socio.Fields.Item("direccion").Value)%>" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right"><div align="left">Comuna:</div></td>
<td><input type="text" name="comuna" value="<%=(editar_socio.Fields.Item("comuna").Value)%>" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right"><div align="left">Cargo:</div></td>
<td><input type="text" name="cargo" value="<%=(editar_socio.Fields.Item("cargo").Value)%>" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right"><div align="left">Area:</div></td>
<td><input type="text" name="area" value="<%=(editar_socio.Fields.Item("area").Value)%>" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right"><div align="left">Fecha_ingreso:</div></td>
<td><input type="text" name="fecha_ingreso" value="<%=(editar_socio.Fields.Item("fecha_ingreso").Value)%>" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right"><div align="left">N_cargas:</div></td>
<td><input type="text" name="n_cargas" value="<%=(editar_socio.Fields.Item("n_cargas").Value)%>" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right"><div align="left">Renta_mensual:</div></td>
<td><input type="text" name="renta_mensual" value="<%=(editar_socio.Fields.Item("renta_mensual").Value)%>" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right"><div align="left">Tipo_socio:</div></td>
<td><input type="text" name="tipo_socio" value="<%=(editar_socio.Fields.Item("tipo_socio").Value)%>" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right"><div align="left">Disponible_reembolso:</div></td>
<td><input type="text" name="disponible_reembolso" value="<%=(editar_socio.Fields.Item("disponible_reembolso").Value)%>" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right"><div align="left">Disponible_convenio:</div></td>
<td><input type="text" name="disponible_convenio" value="<%=(editar_socio.Fields.Item("disponible_convenio").Value)%>" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right"><div align="left">Estado_de_usuario:</div></td>
<td><input type="text" name="estado_de_usuario" value="<%=(editar_socio.Fields.Item("estado_de_usuario").Value)%>" size="32"> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right">&nbsp;</td>
<td><input type="submit" value="Actualizar registro"> </td>
</tr>
</table>
<input type="hidden" name="MM_update" value="form1">
<input type="hidden" name="MM_recordId" value="<%= editar_socio.Fields.Item("Id_socios").Value %>">
</form>
<p>&nbsp;</p>
</body>
</html>
<%
editar_socio.Close()
Set editar_socio = Nothing
%>


   
 Foro Bloqueado  Tema Bloqueado
Ir a:
Los Foros de ASPTutor.com Los Foros de ASPTutor.com
Ir al principio de la Página

 Imprimir Tema
 

Descargas de manuales¦ Ejemplos de código ¦ Artículos mas visitados ¦ Envía tu articulo ¦ Foros ¦
  Libro de visitas ¦Crea un enlace con ASPTutor 
 

    © 2001-Hasta hoy  Pedro Rufo Martín  contactar