Retroceder   Foros del Web > Programación para sitios web > ASP

Respuesta
 
Herramientas Desplegado
Antiguo 15-abr-2008, 14:47   #1 (permalink)
nancy80 ha deshabilitado el karma
 
Fecha de Ingreso: abril-2008
Mensajes: 1
Borrar una Consulta con ASP y JSCRIP

Hola
Estoy comenzando a programar una pagina en ASP y JSCRIPT
ya tengo mi consulta y funciona bien es generada de una base en access tiene 3 tablas relacionadas entre si (Maestro, Detalle prod, Detalle Resp) es una relacion 1 a 1 pero quiero borrar los datos que salgan de esta consulta mediante un boton. Alguien me puede ayudar o tal vez complementar mi problema.

Saludos y Gracias


<%@ LANGUAGE=JScript%>
<%

user=Request.Cookies("nombreusuario");
claveuser=Request.Cookies("username");
tipouser=Request.Cookies("tipousuario");
nombreruta=Request.Cookies("NombreRuta");
claveruta=Request.Cookies("ClaveRuta");
ClaveaConsultar=Request.Cookies("ClaveaConsultar") ;


Consult=1;

curDir = Server.MapPath("p1.mdb");
Conexion = Server.CreateObject("ADODB.Connection");
Conexion.Open("Provider=Microsoft.Jet.OLEDB.4.0;Da ta Source=" +curDir);

function ValidaUsuario()
{

rs=Conexion.Execute("select programa as prog, sem as seman from MaestroVisitas where com ="+Consult);
if(!rs.eof)
{
supervisorConsultar=rs.fields("prog");
return true;
}
else
return false;
}

//creacion del reporte del reporte
function CreaReporteTienda()
{
sql="SELECT m.mvisFolio as folio, t.tiedescripcion as tienda, t.tiedireccion as ciud, format(m.mvisfechahorainicio,'HH:MM:SS') as horai, format(m.mvisfechahorafin,'HH:MM:SS') as horaf, s.supnombre as demo, sum(dt.detprototalventas) as totalventas, m.Semana as seman, m.mvisobservaciones as mvispro, m.mvisobservacionescom as mviscom FROM supervisores s, tiendas t, maestrovisitas m,detalleproductos dt WHERE t.tieclave=m.tieClave and m.supclave=s.SupClave and m.mvisfolio=dt.mvisfolio and m.com="+Consult+" group by t.tiedescripcion, m.mvisfechahorainicio, m.mvisfechahorafin, s.supnombre, m.mvisfolio, m.semana, m.mvisobservaciones, m.mvisobservacionescom, t.tiedireccion order by t.tiedireccion";
rs=Conexion.Execute(sql);
if (!rs.eof)
return true;

else
return false;
}

function BuscaPreguntasDemo()
{
folio=Request.Cookies("folio");
sql="select detDemPregunta as pregunta from detalledemo where mvisfolio='"+folio+"'";
Response.write(sql);
rsTemp=Conexion.Execute(sql);
if(!rsTemp.eof)
return true;
else
return false;
}
%>


<BODY topmargin=0 leftmargin=0>


<!--#include file="firma.asp"-->
<%
if (!firmado())
{
Response.redirect("acceso.asp");
}
%>

&nbsp;<p><!--[if gte vml 1]><v:shapetype id="_x0000_t202"
coordsize="21600,21600" o:spt="202" path="m,l,21600r21600,l21600,xe">
<v:stroke joinstyle="miter"/>
<v:path gradientshapeok="t" o:connecttype="rect"/>
</v:shapetype><v:shape id="_x0000_s1026" type="#_x0000_t202" style='position:absolute;
left:256.5pt;top:110.25pt;width:357.75pt;height:27 .75pt;z-index:3' filled="f"
fillcolor="none" stroked="f" strokecolor="none">
<v:textbox>
<table cellspacing="0" cellpadding="0" width="95%" height="100%" id="table129">
<tr>
<td align="center">
<p><b><font color="#0000FF" size="4">Consulta de Comentarios por Semana</font></b></td>
</tr>
</table>
</v:textbox>
</v:shape><![endif]--><![if !vml]><span style='mso-ignore:vglayout;position:
absolute;z-index:3;left:342px;top:147px;width:481px;height:41 px'><img
width=481 height=41 src="consulta4b116_files/image001.gif"
alt="Text Box: Consulta de Comentarios por Semana
" v:shapes="_x0000_s1026"></span><![endif]></p>
<p>&nbsp;</p>
<p></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p></p>
<p>
<!--#include file="tipou.asp"-->
<font size="2">
<BR>

&nbsp;</font></p>

<TABLE cellpadding=0 cellspacing=0 border=1 id="table149" width="1165">
<TR>
<%
// crecion del reporte
if (ValidaUsuario())
{
if(CreaReporteTienda())
{
folio=rs.fields("folio");
%>
<TD colspan=7 align=center height="26" bgcolor="#CCFFCC"><p class=etiquetan12>
<b><font face="Times New Roman" size="2">Persona que Consulta: <%=supervisorConsultar%></font></b><TR>
<TD bgcolor=#FFFFCC width="85" height="20" align="center"><P class="etiquetan">
<font face="Times New Roman" size="2">Ciudad </font> </TD>
<TD bgcolor=#FFFFCC width="182" height="20" align="center"><P class="etiquetan">
<font face="Times New Roman" size="2">Promotor </font> </TD>
<TD bgcolor=#FFFFCC width="156" height="20" align="center"><P class="etiquetan">
<font face="Times New Roman" size="2">Tienda </font> </TD>
<TD bgcolor=#FFFFCC width="144" height="20" align="center"><P class="etiquetan">
<font face="Times New Roman" size="2">Periodo </font> </TD>
<TD bgcolor=#FFFFCC width="300" height="20" align="center"><P class="etiquetan">
<font face="Times New Roman" size="2">Comentarios de Producto</font></TD>
<TD bgcolor=#FFFFCC width="300" height="20" align="center"><P class="etiquetan">
<font face="Times New Roman" size="2">Comentarios de Producto</font></TD>

<TD bgcolor=#CCFFCC width="288" height="20" align="center"><P class="etiquetan">
<font face="Times New Roman" size="2">
<span style="background-color: #CCFFCC">Comentarios de Competencia</span></font></TD><TR>

<%
while(!rs.eof)
{
%>
<TD width="85" height="24"><P class="etiquetan">
<font face="Times New Roman" style="font-size: 9pt"><%=rs.fields("ciud")%></font></TD>
<TD width="182" height="24"><P class="etiquetan">
<font face="Times New Roman" style="font-size: 9pt"><%=rs.fields("demo")%></font></TD>
<TD width="156" height="24"><P class="etiquetan">
<font face="Times New Roman" style="font-size: 9pt"><%=rs.fields("tienda")%></font></TD>
<TD width="144" height="24"><P class="etiquetan">
<font face="Times New Roman" style="font-size: 9pt"><%=rs.fields("seman")%></font></TD>
<TD width="300" height="24"><P class="etiquetan">
<font face="Times New Roman" style="font-size: 9pt"><%=rs.fields("mvispro")%></font></TD>
<TD width="300" height="24"><P class="etiquetan">
<font face="Times New Roman" style="font-size: 9pt"><%=rs.fields("mviscom")%></font></TD>
<TD width="288" height="24" style="color: #666699"><P class="etiquetan">
<font face="Times New Roman" style="font-size: 9pt"><%=rs.fields("horaf")%></font></TD><TR>
<% rs.movenext;
}
}
else
{
%>
<td width="85"><font size="2" face="Times New Roman">No hay comentarios: <%=supervisorConsultar%></font></TD><TR>
<TD align=center width="85"><font face="Times New Roman" size="2"><INPUT TYPE="button" class="boton" value="Regresar" onclick="window.location='Wrigley_comen.asp';"></font></TD>
<%
}
}
else
{
Response.redirect("erracceso.asp");
}
%>
</TABLE>
<p></p>
<font size="1">
<BR>
<!-- <TABLE border=1 cellpadding=0 cellspacing=0> -->
<!-- AQUI SE MOSTRARA EL SEGUNDO REPORTE: EVALUACION DE LA DEMO -->
<%
if (CreaReporteTienda())
{
while(!rs.eof)
{
sql="select detdemPregunta as pregunta, detDemRespuesta as respuesta from detalledemo where mvisFolio ='"+rs.fields("folio")+"'";
rsTemp=Conexion.Execute(sql);
if (!rsTemp.eof)
{
%>
</font>
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>
<Th><font size="1"><%=rs.fields("tienda")%>
</font>
</TABLE>
<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=0>
<%
while(!rsTemp.eof)
{
%>
<TD BGCOLOR=<%=bgcolor%>><P CLASS =etiquetan8>
<font size="1"><%=rsTemp.fields("pregunta")%></font></TD>
<%
rsTemp.movenext;
}
Response.Write("<TR>");
rsTemp.movefirst;

// hora ponemos las respuestas
while(!rsTemp.eof)
{
%>
<TD><P CLASS =etiquetan8><font size="1"><%=rsTemp.fields("Respuesta")%></font></TD>
<%
rsTemp.movenext;
}

Response.write("</TABLE>");
}
rs.movenext;
}
%>
<font size="2">
<INPUT TYPE="button" value="Regresar" class=boton onclick="window.location='Wrigley_comen_b.asp';"></font><font size="1">
<%
}
%>
</font>
</TABLE>
<p></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</body>
</HTML>
nancy80 está desconectado   Responder Citando
Antiguo 15-abr-2008, 15:03   #2 (permalink)
mc_quake ha deshabilitado el karma
 
Avatar de mc_quake
 
Fecha de Ingreso: enero-2006
Mensajes: 428
Re: Borrar una Consulta con ASP y JSCRIP

drea un boton en un form y mandas una variable lompiar = 1 y la rescatas arriba del sitio si es 1 no muestras nada de lo contrario generasla consulta
__________________
Mc_Quake

Para ayudar en lo que se pueda:Zzz:
mc_quake está desconectado   Responder Citando
Respuesta
No hay votos aún.


Herramientas
Desplegado

Normas de Publicación
No puedes crear nuevos temas
No puedes responder temas
No puedes subir archivos adjuntos
No puedes editar tus mensajes

BB code is Activado
Caritas están Activado
[IMG] está Activado
Código HTML está Desactivado


La Zona horaria es GMT -6. Ahora son las 16:47.


Message Board Statistics

LinkBacks Enabled by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93