Foros del Web » Programando para Internet » ASP Clásico »

problemas para conectarme a la BD en ACCCESS

Estas en el tema de problemas para conectarme a la BD en ACCCESS en el foro de ASP Clásico en Foros del Web. NESECITO AYUDA CON ESTE PROGRAMA NO ME INGRESA LOS DATOS A LA BASES DE DATOS EN ACCESS AQUI MANDO EL CODIGO PARA QUE ME AYUDEN ...
  #1 (permalink)  
Antiguo 24/06/2002, 09:18
hat
 
Fecha de Ingreso: mayo-2002
Mensajes: 75
Antigüedad: 22 años, 1 mes
Puntos: 0
problemas para conectarme a la BD en ACCCESS

NESECITO AYUDA CON ESTE PROGRAMA NO ME INGRESA LOS DATOS A LA BASES DE DATOS EN ACCESS AQUI MANDO EL CODIGO PARA QUE ME AYUDEN A SOLUCIONARLO




<%@language=VBscript%>


<%
set cn=Server.CreateObject("ADODB.connection&quot ;)
cn.open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("noticias.mdb")

dim titulo,texto,autor,email,fecha,foto
dim miconexion,mirecordset,miconsulta,numero_propuesta

autor = Request.Form("autor")
email = Request.Form("email")
titulo = Request.Form("titulo")
texto = Request.Form("texto")
fecha = Request.Form("fecha")
foto = Request.Form("foto")


if (autor = "") and (email = "") and (titulo = "") and (texto = "") then



else

set mirecordset = server.CreateObject("ADODB.RECORDSET")
miconsulta = "noticias"
mirecordset.LockType = adLockOptimistic
mirecordset.CursorType = adOpenKeyset
mirecordset.ActiveConnection = cn
mirecordset.Source = "noticias"
mirecordset.Open


on error resume next
mirecordset.movelast()
if err <> 0 then
end if
numero_propuesta = mirecordset.fields("id_noticia")

n_prop = numero_propuesta + 2

sql = "INSERT INTO PROPUESTAS (id_noticia, autor, email_autor, titulo, texto, fecha, foto) VALUES ("&n_prop&",'"&autor&am p;"','"&email&"','"&am p;titulo&"','"&texto&"' ,'"&date()&"','"&foto&a mp;"')"
'cn.Execute sql,,1
mirecordset=cn.execute(sql)
response.write(sql)
response.write("datos")
'cn.execute(sql)
' Response.Redirect("propuesta_enviada.asp&quot ;)

mirecordset.close


end if



%>
<font face=Arial size=2>

<p><font face="Arial" size="2"><b>NOTICIAS : AGREGAR NOTICIAS</b></font></p>
<font face=Arial size=2>Para ingresar noticias en su seccion definida para noticias, complete todos los campos del
siguiente formulario y presione "Publicar".<br>

<form name="FORMULARIO" method="post" ACTION="n_agregar.asp">
<table WIDTH="500" BORDER="1" CELLSPACING="0" CELLPADDING="2">
<tr>
<td width="91"><font face="Arial" size="2"><b>Autor : </b></font></td>
<td width="324"> <font face="Arial" size="2">
<input type="text" name="autor" size=40 maxlength="255">
</font></td>
</tr>
<tr>
<td width="91"><font face="Arial" size="2"><b>Email :</b></font></td>
<td width="324"><font face="Arial" size="2">
<input type="text" name="email" size=40 maxlength="255">
</font></td>
</tr>
<tr>
<td width="91"><font face="Arial" size="2"><b>Título:& lt;/b></font></td>
<td width="324"> <font face="Arial" size="2">
<input type="text" name="titulo" size=40 MAXLENGTH="255">
</font></td>
</tr>
<tr>
<td valign=top width="91"><font face="Arial" size="2"><b>Texto:</b></font></td>
<td width="324"> <font face="Arial" size="2">
<textarea name="texto" cols=50 rows=10></textarea>
</font></td>
</tr>
<tr>
<td width="91"><font face="Arial" size="2"><b>Fecha : </b></font></td>
<td width="324">
<input type="text" name="fecha">
</td>
</tr>
<tr>
<td width="91"><font face="Arial" size="2"><b>Foto : </b></font></td>
<td width="324">
<input type="file" name="foto">
</td>
</tr>
<tr>
<td width="91"><font face="Arial" size="2"><br>
</font></td>
<td width="324"> <font face="Arial" size="2">
<input type="submit" value=" Publicar " name="agregar">
</font></td>
</tr>
</table>
</form>

</font></font>



Error que me manda es:

Tipo de error:
ADODB.Recordset (0x800A0BB9)
Argumentos incorrectos, fuera del intervalo permitido o en conflicto con otros.
/asp/administrador/n_agregar.asp, line 27
  #2 (permalink)  
Antiguo 24/06/2002, 10:27
 
Fecha de Ingreso: mayo-2002
Mensajes: 45
Antigüedad: 22 años
Puntos: 0
Re: problemas para conectarme a la BD en ACCCESS

Juega con los parámetros del Open, por que algunos puede que no se lleven bien entre si, prueba a ponerlo todos las propiedades sobre la misma linea del Open, haber si ves mejor el error, por que el error es bastante claro.

.Open "noticias",cn, adOpenStatic, adLockReadOnly, adCmdText

Salu23. :)
  #3 (permalink)  
Antiguo 24/06/2002, 11:34
hat
 
Fecha de Ingreso: mayo-2002
Mensajes: 75
Antigüedad: 22 años, 1 mes
Puntos: 0
Re: problemas para conectarme a la BD en ACCCESS

ok

gracias
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 22:29.