Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/07/2006, 14:23
jbco
 
Fecha de Ingreso: junio-2006
Mensajes: 104
Antigüedad: 18 años, 10 meses
Puntos: 1
Problemas con valores

Hola de nuevo amigos del Desarrollo Wed, aqui estoy de nuevo, aqui les presente este formulario. Verifiquen las lineas rojas para ver mi problema y evitar tanto royo.

<%@ Language=VBScript%>
<% Dim oConn,strSQL, objRS
Set oConn = Server.CreateObject("ADODB.Connection")
set rs=Server.CreateObject("ADODB.Recordset")
oConn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("./Ventas.mdb")) %>

<html> <head>

<body>
<h1 align="center">Venta de productos</h1>
<p align="center">Seleccione el producto a comprar:&nbsp;

<select size="1" name="Producto" >
<% strSQL = "SELECT * FROM Productos ORDER BY Productos"
Set RS = oConn.Execute(strSQL)
while not Rs.EOF%>
<option value="<%var=rs.Fields("IdProductos")%>"> <%=rs.Fields("Productos")%></option>
<% Rs.movenext
wend
Rs.close %> </select> </p>

<table border="1" width="80%" height="79" align="center">
<tr>
<td width="25%" height="1" align="center">
<p align="center"><b>PRODUCTOS</b></p>
</td><td width="13%" height="1" align="center">
<p align="center"><b>Cantidad</b></p>
</td>
<td width="12%" height="1" align="center">
<p align="center"><b>Comprar</b></p>
</td><td width="21%" height="1" align="center">
<p align="center"><b>Precio</b></p>
</td>
<td width="29%" height="1" align="center">
<p align="center"><b>Sub-Total</b></p>
</td>
</tr>
<tr>
<td width="25%" height="1">

<p>&nbsp;
<table width="100%" border="1">
<thead>
</thead>
<tbody>
<!--webbot bot="DatabaseRegionStart" startspan
s-columnnames="NombreProducto" s-columntypes="202"
s-dataconnection="Base_de_datos4" b-tableformat="TRUE"
b-menuformat="FALSE" s-menuchoice s-menuvalue b-tableborder="TRUE"
b-tableexpand="TRUE" b-tableheader="TRUE" b-listlabels="TRUE"
b-listseparator="TRUE" i-ListFormat="0" b-makeform="TRUE" s-recordsource
s-displaycolumns="NombreProducto" s-criteria s-order
s-sql="SELECT NombreProducto FROM Precios WHERE Precios.IDProductos=var"
b-procedure="FALSE" clientside SuggestedExt="asp"
s-DefaultFields="IdProductos="
s-NoRecordsFound="Ningún registro devuelto." i-MaxRecords="256"
i-GroupSize="5" BOTID="0" u-dblib="_fpclass/fpdblib.inc"
u-dbrgn1="_fpclass/fpdbrgn1.inc" u-dbrgn2="_fpclass/fpdbrgn2.inc"
<%
fp_sQry="SELECT NombreProducto FROM Precios WHERE Precios.IDProductos=1"
fp_sDefault="IdProductos="
fp_sNoRecords="<tr><td colspan=1 align=left width=""100%"">Ningún registro devuelto.</td></tr>"
fp_sDataConn="Base_de_datos4"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=5
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_iDisplayCols=1
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>
</tbody>
</table>

</td>
<td width="13%" height="1">
<form method="POST" action="compras.asp" webbot-action="--WEBBOT-SELF--">
<p align="center"><input type="text" name="Cpolvo" size="15"></p>
</form>
</td>
<td width="12%" height="1" align="center">
<p align="center"><input type="checkbox" name="Copolvo" value="ON"></p>
</td>
<td width="21%" height="1">

<p align="center">

</td>
<td width="29%" height="1">
<p align="center"></td>
</tr>
</table>

</body>

Lo que necesito por el momento es que value del Sect que se encuentre activo o seleccionado sea el valor condicional del Where, claro en lugar de var que tengo puesto, es algo mas o menos asi:
s-sql="SELECT NombreProducto FROM Precios WHERE Precios.IDProductos=Select.value"
ó
s-sql="SELECT NombreProducto FROM Precios WHERE Precios.IDProductos='var'",
pero asi no funciona, alguien sabe como.

Gracias por su ayuda.

Última edición por jbco; 19/07/2006 a las 15:02