ASP - problema con conexion a base de datos

 
Vista:

problema con conexion a base de datos

Publicado por william (1 intervención) el 05/12/2006 23:27:53
hola amigos, es la primera vez que entro a este foro, la verdad estoy super desesperado con estos problemas que tengo, ya tengo como 15 dias y no los puedo resolver, el problema es que cuando quiero agregar un cliente a mi base de datos, me marca el siguiente error:

ADODB.Recordset (0x800A0CB3)
El recordset actual no admite actualizaciones. Puede ser una limitacion del proveedor o del tipo de bloqueo seleccionado.
/servidor/proyecto tienda asp/addcli.asp, line 13

este es el codigo

addcli.asp

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
set conexion =Server.CreateObject("ADODB.Connection")
set RsCli = Server.CreateObject("ADODB.RecordSet")
conexion.provider="microsoft.jet.4.0;"
conexion.Open "c:/servidor/proyecto tienda asp/tienda.mdb"
SQL = " SELECT * FROM CLIENTES WHERE NICK=' "& request.Form("txtNIF2") & " ' "
RsCli.Open SQL,conexion,2,3
if (RsCli.EOF)then
RsCli.AddNew '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''aqui me marca el error
RsCli("NICK")=request.Form("txtNIF2")
RsCli("NOMBRE")=request.Form("txtNombre")
RsCli("APELLIDOS")=request.Form("txtApellidos")
RsCli("DIRECCION")=request.Form("txtDireccion")
RsCli("POBLACION")=request.Form("txtPoblacion")
RsCli("PROVINCIA")=request.Form("txtProvincia")
RsCli("PAIS")=request.Form("txtPais")
RsCli("TELEFONO")=request.Form("txtTelefono")
RsCli("EMAIL")=request.Form("txtEMail")
RsCli("CUENTA")=request.Form("txtCuenta")
RsCli.Update
RsCli.Close
conexion.Close
set cliente= Server.CreateObject("Scripting.Dictionary")
cliente.Add 1,request.Form("txtNIF")
set session("cliente")=cliente
response.Redirect "addped.asp"
else
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Cliente Existente</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#9999ff" link="#000000" vlink="#000000" alink="#ff0000">
<div align="center">
<h1>Ya existe un cliente con ese NIF</h1>
<BR>
<a href="zoncli.asp">Registrarse</a>
</div>

</body>
</html>
<%end if%>
<%RsCli.Close
conexion.Close%>



y el otro error es este

Microsoft jet database engine (0x80040E24)
El conjunto de filas no admite recuperacion hacia atras.

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
if isObject(session("carrito"))then
set carrito=session("carrito")
else
set carrito = Server.CreateObject("Scripting.Dictionary")
end if
if(carrito.Count=0) then%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>NO EXISTE</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#9999ff" link="#000000" vlink="#000000" alink="#ff0000">
<div align="center">
<h1>Su carrito esta vacio en este momento.</h1>
<br>
<a href="index.asp">Inicio</a>
</div>

</body>
</html>
<%else%>
<%
arrClav=carrito.Keys()
arrElem=carrito.Items()
set conexion =server.CreateObject("ADODB.Connection")
conexion.provider="microsoft.jet.4.0;"
conexion.Open "c:/servidor/proyecto tienda asp/tienda.mdb"
set Rscab =server.CreateObject("ADODB.RecordSet")
SQL= "SELECT * FROM PEDIDOCAB"
RsCab.Open SQL,conexion,2,3
if (Rscab.EOF)then
numero=1
else
RsCab.Movelast ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''AQUI ME MARCA EL ERROR
numero=RsCab("NUMEROPEDIDO")+1
end if
RsCab.AddNew
RsCab("NUMEROPEDIDO")=numero
RsCab("NIFCLIENTE")request.QueryString("NICK")
RsCab("FECHA")=date
set RsDet =server.CreateObject("ADODB.RecordSet")
set RsProd =server.CreateObject("ADODB.RecordSet")
SQL= "SELECT * FROM PEDIDODET"
RsDet.Open SQL,conexion,2,3
for i =0 to carrito.Count-1
SQL="SELECT * FROM PRODUCTOS WHERE CODIGO ="& arrClav(i)
RsProd.Open SQL,conexion,2,3
totpro=RsProd("PRECIO") * arrElem(i)
stock=RsProd("STOCK") - arrElem(i)
RsProd("STOCK")=stock
Rsprod.Update
RsDet.AddNew
RsDet("NUMEROPEDIDO")=numero
RsDet("CODIGOPRODUCTO")= arrClav(i)
RsDet("CANTIDAD")=arrElem(i)
RsDet("TOTALPRODUCTO")=totpro
totped=totped+totpro
RsDet.Update
RsProd.Close
next
RsDet.Close
RsCab("TOTALPEDIDO")=totped
RsCab.Update
%>

<html>
<head>
<title>PEDIDO GRABADO</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#9999ff" link="#000000" vlink="#000000" alink="#ff0000">
<div align="center">
<h1>Su pedido ha sido grabado, en breve lo recibira en su domicilio.</h1>
<br>
<a href="index.asp">Inicio</a>
</div>

</body>
</html>
<%
RsCab.Close
conexion.Close
carrito.RemoveAll
set session("carrito")=carrito
%>
<%end if%>


ES URGENTE POR FAVOR.

GRACIAS
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:problema con conexion a base de datos

Publicado por Jc (7 intervenciones) el 07/12/2006 04:12:45
Saludos,

espero te solucione tu problema de arriba de "El recordset actual no admite actualizaciones. Puede ser una limitacion del proveedor o del tipo de bloqueo seleccionado"

selecciona tu base de datos y dale permisos de lectura y escritura al usuarioa IUSR_nombre de tu pc,

saludos, y espero te solucione tu problema :D
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar