| Usuario |
Herror añadir registro a base dato... |
Desconocido
|
| Enviado - 18/10/2004 |
| |
Hola hola!!!
Ya se que error no lleva h, pero a que pega al ojo ;->
Bueno, al tema.
Al añadir un registro a una BD desde un formulario, me da el siguiente error:
Información técnica (para personal de soporte técnico)
HTTP 500.100. Error interno del servidor: error de ASP
Servicios de Internet Information Server
Tipo de error:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][Controlador ODBC Microsoft Access] La operación debe usar una consulta actualizable.
/notas_adm/pags/formulario.asp, línea 115
He dado permisos en la carpeta del servidor IIS que contiene la BD, y nada. La conexion a la base de datos, creo, esta bien definida, y consigo ver los registros (en otra pagina).
SOCORROOOO!!!
Estoy empezando en esto, y me atasque.....
Muchas gracias, aunque solo sea por leer este MSG.
Un saludo...de Juantxo |
| |
|
Desconocido
|
| Enviado - 19/10/2004 |
| |
MMM....
puede ser por el objeto record set o por los argumentos que le pasas al llamar a la inserción
podrías enviarme el codigo ...
igual te puedo echar una mano. ...
Alvro
[email protected] |
| |
|
Desconocido
|
| Enviado - 20/10/2004 |
| |
Este es el codigo.
Esta generado con Dreamweaver, por lo que espero no tenga errores. Yo me temo mas un tema de permisos, pero no de donde dar mas permisos!!!
Gracias de todas formas.
______________________________
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../Connections/notas.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 & "?" & Request.QueryString
End If
' boolean to abort record edit
MM_abortEdit = false
' query string to execute
MM_editQuery = ""
%>
<%
' *** Insert Record: set variables
If (CStr(Request("MM_insert")) = "frm_insertar") Then
MM_editConnection = MM_notas_STRING
MM_editTable = "Notas"
MM_editRedirectUrl = "insert_ok.htm"
MM_fieldsStr = "Asunto|value|Texto_completo|value"
MM_columnsStr = "Asunto|',none,''|Texto_completo|',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
%>
<%
' *** Insert Record: construct a sql insert statement and execute it
Dim MM_tableValues
Dim MM_dbValues
If (CStr(Request("MM_insert")) <> "") Then
' create the sql insert statement
MM_tableValues = ""
MM_dbValues = ""
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_tableValues = MM_tableValues & ","
MM_dbValues = MM_dbValues & ","
End If
MM_tableValues = MM_tableValues & MM_columns(MM_i)
MM_dbValues = MM_dbValues & MM_formVal
Next
MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues & ") values (" & MM_dbValues & ")"
If (Not MM_abortEdit) Then
' execute the insert
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
%>
<html>
<head>
<title>Documento sin título</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<p>Insertar Notas </p>
<form action="<%=MM_editAction%>" method="POST" name="frm_insertar" id="frm_insertar">
<table align="center">
<tr valign="baseline">
<td nowrap align="right"><p> </p>
<p><strong>Asunto:</strong></p>
<p> </p></td>
<td> <p> </p>
<p> <strong>
<input type="text" name="Asunto" value="Escriba aqui el titulo de la nota" size="32">
</strong></p></td>
</tr>
<tr valign="baseline">
<td height="184" align="right" valign="top" nowrap><strong>Texto_completo:</strong></td>
<td> <textarea name="Texto_completo" cols="40" rows="10">Escriba aqui el contenido de la nota.</textarea>
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right"><p> </p>
<p> </p>
<p> </p></td>
<td> <p> </p>
<p>
<input name="btn_insertreg" type="submit" id="btn_insertreg" value="Insertar registro">
</p></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="frm_insertar">
</form>
<p> </p>
</body>
</html>
__________________________ |
| |
|
|
|