Tengo un problema con el .asp q he creado, q creo q viene de no guardar el autonumerico.
1º os pongo el código:
Cita:
Tengo un IdEmpresa autonumerico. No introduzco el valor en la anterior página xq se supone q tendria q ponerlo él mismo.<!doctype html public "-//w3c//dtd html 3.2//en">
<html>
<head>
<title>(Type a title for your page here)</title>
<%@ LANGUAGE=JScript %>
<meta name="GENERATOR" content="Arachnophilia 4.0">
<meta name="FORMATTER" content="Arachnophilia 4.0">
</head>
<body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">
<%
conexion=new ActiveXObject("ADODB.Connection")
conexion.Open ("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ="+Server.MapPath("PDCP.mdb")+";")
registro1=new ActiveXObject("ADODB.RecordSet")
x="select * from 902_DATOS_GENERALES where Empresa='"+Request.Form("empresa")+"'"
registro1.Open (x, conexion, 3, 0x0002)
if(registro1.EOF)
{
registro1.Addnew ()
registro1("Empresa") = parseInt(Request.form ("empresa"))
registro1.Update()
Response.Write("Datos incorrectos")
}
else
Response.Write("Nombre de la empresa no válida")
%>
</body>
</html>
<html>
<head>
<title>(Type a title for your page here)</title>
<%@ LANGUAGE=JScript %>
<meta name="GENERATOR" content="Arachnophilia 4.0">
<meta name="FORMATTER" content="Arachnophilia 4.0">
</head>
<body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">
<%
conexion=new ActiveXObject("ADODB.Connection")
conexion.Open ("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ="+Server.MapPath("PDCP.mdb")+";")
registro1=new ActiveXObject("ADODB.RecordSet")
x="select * from 902_DATOS_GENERALES where Empresa='"+Request.Form("empresa")+"'"
registro1.Open (x, conexion, 3, 0x0002)
if(registro1.EOF)
{
registro1.Addnew ()
registro1("Empresa") = parseInt(Request.form ("empresa"))
registro1.Update()
Response.Write("Datos incorrectos")
}
else
Response.Write("Nombre de la empresa no válida")
%>
</body>
</html>
Aqui esta el error:
Cita:
La linea 43 es el Update, cuando quiero ya guardar los datos. Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][Controlador ODBC Microsoft Access]Error en fila
/AltaEmpresa2.asp, línea 43
[Microsoft][Controlador ODBC Microsoft Access]Error en fila
/AltaEmpresa2.asp, línea 43
¿Alguien me puede ayudar por favor?
Muchas gracias.