Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   HTML, Javascript y otros (https://www.clubdelphi.com/foros/forumdisplay.php?f=38)
-   -   Borrar un registro de mi bd en asp con RS (https://www.clubdelphi.com/foros/showthread.php?t=68647)

omitraz 26-06-2010 20:21:01

Borrar un registro de mi bd en asp con RS
 
Buenas tardes, no se donde colocar mi consulta, espero que en este tema sea el lugar apropiado.:D

Utilizo asp, bd firebird con ibexpert, al intentar eliminar el registro no me muestra ingun error, simplemente no borra el registro, el codigo es el siguiente:

Código:

<%Dim Conex,sSQL,RS
        USUARIO=Request.Form("USUARIO")
        Set Conex = Server.CreateObject("ADODB.Connection")
        Set RS= Server.CreateObject("ADODB.Recordset")
        Conex.open "Driver=Firebird/InterBase(r)    driver;Uid=sysdba;Pwd=masterkey;DbName=127.0.0.1:C:\PRUEBA\RADIO.FDB;" 
        sSQL="Delete From LOCUTOR Where USUARIO='&USUARIO&'"
        set RS=Conex.execute(sSQL)%>

:confused:
Mi tabla es LOCUTOR y mi registro es Usuario el cual es la llave primaria, agradeseria cual quier comentario, por su atencion gracias.

omitraz 28-06-2010 17:53:44

Probando con otro codigo
 
Hola buenos dias e probado con otra sentencia de SQL y otro codigo de asp y me arroja el siguiente error:

Dynamic SQL Error SQL error code = -104 Unexpected end of command

el codigo es el siguiente:

Código:

        sSQL = "delete from LOCUTOR where USUARIO = " & Request.QueryString("USUARIO")
        Conex.Execute(sSQL)

Cual quier comentario se agradese.

omitraz 28-06-2010 23:34:12

Resuelto
 
El error se necontraba en la siguiente linea:
Código:

<%     

  while (not RS.Eof)
      Response.Write("<tr><td>&nbsp;" & RS("USUARIO") & "&nbsp;</td>")
      Response.Write("<td><a href='ejemplo8.asp?USUARIO=" & RS("USUARIO")
& "'>borrar</a></td></tr>") 
 RS.MoveNext
  wend
   
  Conex.Close
  set RS = nothing
  set Conex = nothing

%>



La franja horaria es GMT +2. Ahora son las 00:32:27.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi