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

Ayuda

Estas en el tema de Ayuda en el foro de ASP Clásico en Foros del Web. Tengo el siguiente codigo: Código: <!--#include file="inc_database.asp" --> <!--#include file="inc_funciones.asp" --> <!--#include file="inc_functions.asp" --> <html> <head> <title>Añadir Seccion</title> </head> <body> <% txtAcc = Request.QueryString("acc") txtSecc ...
  #1 (permalink)  
Antiguo 21/02/2003, 12:29
Avatar de meru-kun  
Fecha de Ingreso: noviembre-2002
Ubicación: Madrid
Mensajes: 854
Antigüedad: 21 años, 6 meses
Puntos: 0
Ayuda

Tengo el siguiente codigo:
Código:
<!--#include file="inc_database.asp" -->
<!--#include file="inc_funciones.asp" -->
<!--#include file="inc_functions.asp" -->
<html>
<head>
<title>Añadir Seccion</title>
</head>
<body>
<%
txtAcc = Request.QueryString("acc")
txtSecc = Request.QueryString("secc")
txtGameID = Request.QueryString("ID")
txtInfo = Request.Form("info")
txtHover = Request.Form("hover")
txtASP = Request.QueryString("ASP")
%>
<%
If txtAcc = "AddNew" Then

 If txtASP = "No" Then
 
  txtInfo = HTMLEncode(txtInfo)
 
 Else
 
 End If
 
response.write txtSecc & txtGameID & txtInfo & txtHover
%>
<%
' ** Dar un valor a ID_SECCION
strSQLCheck = "SELECT ID_SECCION FROM GAMES_SECC WHERE ID_JUEGO=" & txtGameID &" ORDER BY ID_SECCION DESC"
Set MRC = MyConn.Execute(strSQLCheck)
 txtSeccNewID = MRC("ID_SECCION") + 1
MRC.Close
Set MRC = Nothing

strSQLAdd = "SELECT ID_JUEGO, ID_SECCION, SECCION, LINK_SECCION, INFO, AUTOR_ID FROM GAMES_SECC"
 MyRecordset.open strSQLAdd, MyConn, 2,3
  MyRecordset.addnew
   MyRecordset("ID_JUEGO") = txtGameID
   MyRecordset("ID_SECCION") = txtSeccNewID
   MyRecordset("SECCION") = txtSecc
   MyRecordset("LINK_SECCION") = left(3, txtSecc)
   MyRecordset("INFO") = txtHover
   MyRecordset("AUTOR_ID") = session("usrID")
    MyRecordset.Update

%>
<% End If %>
</body>
</html>
Y cuando lo ejecuto me da un error en tiempo de ejecucion:
Error de Microsoft VBScript en tiempo de ejecución error '800a01a8'

Se requiere un objeto: ''

/_index/add_secc.asp, line 39

Justo el error es esta linea:
MyRecordset.open strSQLAdd, MyConn, 2,3

¿Cual es el problema?
__________________
Tu portal de manga y anime.
  #2 (permalink)  
Antiguo 21/02/2003, 12:33
Avatar de urjose  
Fecha de Ingreso: diciembre-2001
Mensajes: 5.286
Antigüedad: 22 años, 5 meses
Puntos: 1
Y en que momento creas MyRecordset y MyConn?
  #3 (permalink)  
Antiguo 21/02/2003, 15:39
Avatar de meru-kun  
Fecha de Ingreso: noviembre-2002
Ubicación: Madrid
Mensajes: 854
Antigüedad: 21 años, 6 meses
Puntos: 0
MyConn esta creado en el archivo inc_database.asp, y my recordset no estsa creado en ninguna parte, pero tengo ese mismo codigo en otras partes de la web y me funciona...

Entonces, para que vaya bien, cambio lo de MyRecordset.open por MyConn.open?
__________________
Tu portal de manga y anime.
  #4 (permalink)  
Antiguo 21/02/2003, 16:06
Avatar de bakanzipp  
Fecha de Ingreso: noviembre-2001
Ubicación: santiago de shilli
Mensajes: 2.554
Antigüedad: 22 años, 7 meses
Puntos: 0
y si hace esto?
Código:
<%
' ** Dar un valor a ID_SECCION
strSQLCheck = "SELECT ID_SECCION FROM GAMES_SECC WHERE ID_JUEGO=" & txtGameID &" ORDER BY ID_SECCION DESC"
Set MRC = MyConn.Execute(strSQLCheck)
 txtSeccNewID = MRC("ID_SECCION") + 1

strSQLAdd = "SELECT ID_JUEGO, ID_SECCION, SECCION, LINK_SECCION, INFO, AUTOR_ID FROM GAMES_SECC"
 MRC.open strSQLAdd, MyConn, ,3
 MRC.addnew
 MRC("ID_JUEGO") = txtGameID
 MRC("ID_SECCION") = txtSeccNewID
 MRC("SECCION") = txtSecc
 MRC("LINK_SECCION") = left(3, txtSecc)
 MRC("INFO") = txtHover
 MRC("AUTOR_ID") = session("usrID")
 MRC.Update

%>
<% End If %>

MRC.Close
Set MRC = Nothing
sino cambio tu codigo po un update... yo no paso este cosa del :AddNew
  #5 (permalink)  
Antiguo 21/02/2003, 22:54
Avatar de urjose  
Fecha de Ingreso: diciembre-2001
Mensajes: 5.286
Antigüedad: 22 años, 5 meses
Puntos: 1
Creo que debes usar algo asi

-
-
-

Set MyRecordset=Server.CreateObject("ADODB.Recordset")
strSQLAdd = "SELECT ID_JUEGO, ID_SECCION, SECCION, LINK_SECCION, INFO, AUTOR_ID FROM GAMES_SECC"
MyRecordset.open strSQLAdd, MyConn, 2,3
MyRecordset.addnew
MyRecordset("ID_JUEGO") = txtGameID
MyRecordset("ID_SECCION") = txtSeccNewID
MyRecordset("SECCION") = txtSecc
MyRecordset("LINK_SECCION") = left(3, txtSecc)
MyRecordset("INFO") = txtHover
MyRecordset("AUTOR_ID") = session("usrID")
MyRecordset.Update

-
-
-
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:14.