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

[SOLUCIONADO] Eliminar columna Access y Asp

Estas en el tema de Eliminar columna Access y Asp en el foro de ASP Clásico en Foros del Web. Tengo este codigo que es para agregar ciertos campos a una BD access: Código HTML: <%@ Language=VBScript %> <html> <head> <title> Registro de Marcadores </title> ...
  #1 (permalink)  
Antiguo 05/12/2014, 08:29
 
Fecha de Ingreso: noviembre-2014
Ubicación: Lima-Peru
Mensajes: 22
Antigüedad: 9 años, 5 meses
Puntos: 0
Pregunta Eliminar columna Access y Asp

Tengo este codigo que es para agregar ciertos campos a una BD access:
Código HTML:
<%@ Language=VBScript %> 

  <html> 
  <head> 
  <title>Registro de Marcadores</title> 
<!--      mapa-->
            <style>
        #mapa{
            width: 700px;
            height: 450px;
            float:left;
            background: white;
        }
        #infor{
            width: 700px;
            height: 450px;
            float:left;
        }
    </style>



<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-2.0.3.min.js" ></script>


<script>

    
    var marcadores_nuevos = [];

    
    function quitar_marcadores(lista) {
        for (i in lista) {
            lista[i].setMap(null);
        }
    }

    $(document).on("ready", function () {

        var formulario = $("#formulario");

        var punto = new google.maps.LatLng(-11.67840, -76.39702);
        var config = {
            zoom: 10,
            center: punto,
            mapTypeId: google.maps.MapTypeId.ROADMAP
        };
        var mapa = new google.maps.Map($("#mapa")[0], config);

        google.maps.event.addListener(mapa, "click", function (event) {
            var coordenadas = event.latLng.toString();

            coordenadas = coordenadas.replace("(", "");
            coordenadas = coordenadas.replace(")", "");

            var lista = coordenadas.split(",");
                
            var direccion = new google.maps.LatLng(lista[0], lista[1]);

            var marcador = new google.maps.Marker({
                position: direccion,
                map: mapa,
                animation: google.maps.Animation.DROP,
                draggable: true
            });
            


            
            formulario.find("input[NAME='coorx']").val(lista[0]);
            formulario.find("input[NAME='coory']").val(lista[1]);

            formulario.find("input[name='titulo']").focus();

                
            

            
            marcadores_nuevos.push(marcador);

            google.maps.event.addListener(marcador, "click", function () {

            });

            
            quitar_marcadores(marcadores_nuevos);
            
            marcador.setMap(mapa);

        });

    });
</script>
<!--      mapa-->
  </head> 
      <!--mapa-->
       <div id="mapa">
        <h2> mapa</h2>
    </div>
    <div id="infor">

<!--mapa-->
 
  <% 
   If Not Request.QueryString("Message") = "True" Then 
  %> 
     <p> 
    <FORM NAME="GuestBook1" METHOD="GET" ACTION="AgregarBD.asp"> 
     <table> 
       <tr> 
       <td><font face="arial">Titulo:</td><td><INPUT TYPE="TEXT" NAME="tit" size="30"></td> 
       </tr><tr> 
       <td><font face="arial">Descripcion:</td><td><INPUT TYPE="TEXT" NAME="des" size="30"></td> 
       </tr><tr> 
       <td><font face="arial">Coordenada x:</td><td><INPUT TYPE="TEXT" NAME="coorx" size="30"></td> 
       </tr><tr> 
      <td><font face="arial">Coordenada y:</td><td><INPUT TYPE="TEXT" NAME="coory" size="30"></td> 
	   </tr><tr>
   <td><font face="arial">Identificador:</td><td><INPUT TYPE="TEXT" NAME="iden" size="30"></td> 
       </tr> 
     </table> 
    
     </p> 

     <p> 
     <INPUT TYPE="HIDDEN" NAME="Message" VALUE="True"> 
     <INPUT TYPE="SUBMIT" VALUE="Guardar Datos"> 
     </FORM> 
     </p> 

  <% 
   Else 
     dim strTB1, strTB2, strTB3, strTB4, strMB1, strCommand 
     strTB1 = Server.HTMLEncode(Request.QueryString("tit")) 
     strTB2 = Server.HTMLEncode(Request.QueryString("des")) 
     strTB3 = Server.HTMLEncode(Request.QueryString("coorx")) 
     strTB4 = Server.HTMLEncode(Request.QueryString("coory")) 
     strMB1 = Server.HTMLEncode(Request.QueryString("iden")) 
     
  
	if strTB1="" and strTB2="" and strTB3="" and strTB4="" then
		Response.Write("Debe ingresar los datos...")
	Elseif (not isNumeric(StrMB1)) then
		 Response.Write("...")
	else
     strProvider = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Nueva carpeta\PRUEBADB.mdb;"
                     
     Set objConn = server.createobject("ADODB.Connection")  

     objConn.Open strProvider  
	 
     strCommand = "INSERT INTO grabar (titulo, descripcion, coordenadax, coordenaday, identificador) VALUES ('" 
     strCommand = strCommand & strTB1 & "','" & strTB2 & "','" & strTB3 & "','" & strTB4 & "','" & strMB1 
     strCommand = strCommand & "')" 

	 
     objConn.Execute strCommand 

     Response.Write("Datos agregados correctamente.") 
	 end if
	
     End If 
  %> 

	<center>
		<a href="index.html">Volver ala página de Inicio</a><br><br>
		<a href="AgregarBD.asp">Agregar otro registro</a>
		
	</center>
	
  </font> 
  <body> 


  </body> 
  </html> 
Ahora mi consulta es como reemplazar el codigo para que en vez de agregar registros los borre segun el identificador. Creo que se soluciona solo cambiando la sentencia de la BD pero no estoy seguro.
Gracias de antemano.
Saludos.
  #2 (permalink)  
Antiguo 05/12/2014, 10:07
 
Fecha de Ingreso: enero-2008
Ubicación: Málaga - España
Mensajes: 346
Antigüedad: 16 años, 3 meses
Puntos: 13
Respuesta: Eliminar columna Access y Asp

SQL = "DELETE FROM nombre_de_tu_tabla WHERE identificador = ........"
objconn.execute SQL
  #3 (permalink)  
Antiguo 05/12/2014, 10:10
 
Fecha de Ingreso: noviembre-2014
Ubicación: Lima-Peru
Mensajes: 22
Antigüedad: 9 años, 5 meses
Puntos: 0
Respuesta: Eliminar columna Access y Asp

PEro estimado, la BD que uso es Access .. viene a ser lo mismo?
Y en esta linea que me citaste : "DELETE FROM nombre_de_tu_tabla WHERE identificador = ........"
en los puntos suspencivos (...) que viene a ir?
Espero me ayudes.
Saludos
  #4 (permalink)  
Antiguo 05/12/2014, 10:28
 
Fecha de Ingreso: enero-2008
Ubicación: Málaga - España
Mensajes: 346
Antigüedad: 16 años, 3 meses
Puntos: 13
Respuesta: Eliminar columna Access y Asp

En la linea de puntos suspensivos, va el valor del identificador que quieres eliminar
  #5 (permalink)  
Antiguo 05/12/2014, 10:35
 
Fecha de Ingreso: noviembre-2014
Ubicación: Lima-Peru
Mensajes: 22
Antigüedad: 9 años, 5 meses
Puntos: 0
Respuesta: Eliminar columna Access y Asp

Oka ya lo pude solucionar con esta linea de codigo :

strCommand = "DELETE * FROM grabar where identificador ='" & request.querystring("identificador")&"'"

objConn.Execute strCommand

Igual gracias por tu tiempo.
Saludos c:
  #6 (permalink)  
Antiguo 10/12/2014, 03:07
 
Fecha de Ingreso: diciembre-2014
Mensajes: 1
Antigüedad: 9 años, 4 meses
Puntos: 0
Respuesta: Eliminar columna Access y Asp

It's frustrating because all collections of skincare products claim their's is not worst at avoiding those terrible break-outs as well as the power to clean. If they keep discussing, they'll quickly inform you that can be restored by their product' strength' plus 'take decades' off your skin layer. There isn't any shock whatsoever when folks pay attention to the hype [URL="http://zm2dev.com/my-observation-about-hydresence/"]Hydresence[/URL], then walk-away feeling. So there are toners or any soaps the artists when they all declare to become the best? How do you actually develop a skin care plan that actually is better for you? How can one actually make certain to block their pores that all-they're doing is currently investing plenty of cash? Here are some tips to assist you find out which skincare products would be the best skin care items on your Skin Care Tips type.

Etiquetas: access, asp, bd
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 23:28.