Ver Mensaje Individual
  #14 (permalink)  
Antiguo 01/10/2010, 10:29
junnior
 
Fecha de Ingreso: julio-2007
Mensajes: 58
Antigüedad: 17 años, 5 meses
Puntos: 0
Respuesta: Busqueda Multiple en .asp

ok, prueba,

<HTML>
<TITLE> Search Plan Status information </TITLE>
<body bgcolor="#FFFFFF" bgproperties="fixed" background="ibmbackgroundsuave.jpg">
<p style="margin-top: 0; margin-bottom: 0">
<img SRC="ServiceManagement.bmp" width="600" height="95"> </p>
&nbsp; </p>
<table width="100%" align=left>
<td width="50%" align=right>
<table align="left">
<td align="left">
<p style="margin-top: 0; margin-bottom: 0">&nbsp;
<a href="http://www.forosdelweb.com/f15/PlanManagementTool/Default.htm"><font color="#000000">Home</font></a>
<font color="#000000"> | </font>
<a target="_top" href="search.htm"><font color="#000000">Plan Status Search</font></a>
<font color="#000000"> | </font>
</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
<p style="margin-top: 0; margin-bottom: 0">
</p>
<br>
</p>
<hr>

<%
poo = Request.Form ("texto")
sta = Request.Form ("nombre")
'opcional
set rs = Server.CreateObject("ADODB.Recordset")

sql = " select * from tabla "

If(poo <>"") then
Sql2 = sql2 & " WHERE Pool LIKE '%" & poo & "%' "
end if

If(sta <>"") then
Sql2 = sql2 & " WHERE Status LIKE '%" & sta & "%' "
end if

If(poo <>"" and sta <>"") then
Sql2 = sql2 & " WHERE Status LIKE '%" & sta & "%' and Pool LIKE '%" & poo & "%' "
end if

'concateno variables
sql = sql & sql2

'espero que tu coneccion sea buena.
dbfile=Server.MapPath("fpdb/ticketsgenerales.mdb")
Set OBJdbConnection=Server.CreateObject("ADODB.Connect ion")
OBJdbConnection.Open "driver={Microsoft Access Driver (*.mdb)};dbq="&dbfile
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open Sql , OBJdbConnection, 3, 3 %>

<CENTER>


<TABLE BORDER=1>
<TR>
<tr bgcolor= "#990000">
<TH><font color="#FFFFFF">Clave</font></TH>
<TH><font color="#FFFFFF">Manager Approval</font></TH>
<TH><font color="#FFFFFF">Category</font></TH>
<TH><font color="#FFFFFF">Priority</font></TH>
<TH><font color="#FFFFFF">Description</font></TH>
<TH><font color="#FFFFFF">Pool</font></TH>
<TH><font color="#FFFFFF">OwnerTrainer</font></TH>
<TH><font color="#FFFFFF">AssociateTrainee</font></TH>
<TH><font color="#FFFFFF">DueDate</font></TH>
<TH><font color="#FFFFFF">StartDate</font></TH>
<TH><font color="#FFFFFF">DateCompleted</font></TH>
<TH><font color="#FFFFFF">AdditionalComments</font></TH>
<TH><font color="#FFFFFF">Status</font></TH>

<% DO UNTIL rs.Eof %>
<TR>

<TD><b><CENTER><font face="Verdana" size="2"> <%= rs("Clave") %> </CENTER></b></TD>
<TD><b><CENTER><font face="Verdana" size="2"> <%= rs("ManagerApproval") %> </CENTER></b></TD>
<TD><b><CENTER><font face="Verdana" size="2"> <%= rs("Category") %> </CENTER></b></TD>
<TD><b><CENTER><font face="Verdana" size="2"> <%= rs("Priority") %> </CENTER></b></TD>
<TD><b><CENTER><font face="Verdana" size="2"> <%= rs("Description") %> </CENTER></b></TD>
<TD><b><CENTER><font face="Verdana" size="2"> <%= rs("Pool") %> </CENTER></b></TD>
<TD><b><CENTER><font face="Verdana" size="2"> <%= rs("OwnerTrainer") %> </CENTER></b></TD>
<TD><b><CENTER><font face="Verdana" size="2"> <%= rs("AssociateTrainee") %> </CENTER></b></TD>
<TD><b><CENTER><font face="Verdana" size="2"> <%= rs("DueDate") %> </CENTER></b></TD>
<TD><b><CENTER><font face="Verdana" size="2"> <%= rs("StartDate") %> </CENTER></b></TD>
<TD><b><CENTER><font face="Verdana" size="2"> <%= rs("DateCompleted") %> </CENTER></b></TD>
<TD><b><CENTER><font face="Verdana" size="2"> <%= rs("AdditionalComments") %> </CENTER></b></TD>
<TD><b><CENTER><font face="Verdana" size="2"> <%= rs("Status") %> </CENTER></b></TD>

<% rs.MoveNext
LOOP
set rs = Nothing
OBJdbConnection.Close
set OBJdbConnection = Nothing%>


</TABLE>

&nbsp;
<table width="84%" align="left">
<tr>
<td width="50%" align="right">
<table align="left">
<tr>
<td align="center">

<table width="100%" align="left">
<td width="50%" align="right">
<table align="left">
<td align="left">

</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
<p>
</BODY>
</HTML>