Si funciona bien , ¿por qué el error?
Publicado por Amaya (1 intervención) el 23/03/2006 12:48:28
Hola!! Quiero cargar un combo con fabricantes y elegir uno y que me saque el software de ese fabricante. El caso es que me carga bien el combo y luego me aparece este error debajo:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][Controlador ODBC Microsoft Access] Error de sintaxis (falta operador) en la expresión de consulta 'id_fabricante='.
Si no haces caso del error funciona perfectamente, pero no sé como quitarlo, no entiendo qué está mal.
El error da en la línea resaltada.
Espero que alguien me pueda ayudar. Muchas gracias.
<% Dim fab
Dim fab_numRows
Set fab = Server.CreateObject("ADODB.Recordset")
fab.ActiveConnection = MM_bd_STRING
fab.Source = "SELECT * FROM CatSoftFabricantes"
fab.CursorType = 0
fab.CursorLocation = 2
fab.LockType = 1
fab.Open()
fab_numRows = 0 %>
<form method="post" action="" name="clte" onSubmit="">
<select size="1" name="id" onChange="javascript:location.replace('listfab.asp?id=' + clte.id.options[clte.id.selectedIndex].value)">
<option value="todos">-Seleccionar fabricante-</option>
<%
do while not fab.eof
NombreComercial = fab("razonsocial")
Id_empresa = fab("Id_fabricante")
bs = request.querystring("id")
if bs <> "" then
if CInt(bs) = CInt(Id_empresa) then
response.write "<option value="&Id_empresa&" selected>"&NombreComercial&"</option>"
elseif CInt(bs) <> CInt(Id_empresa) then
response.write "<option value="&Id_empresa&">"&NombreComercial&"</option>"
end if
else
response.write "<option value="&Id_empresa&">"&NombreComercial&"</option>"
end if
fab.movenext
loop
%>
</select>
</form>
table width="350" border="0">
<%
Dim rs
Dim rs_numRows
bf=request.QueryString("id")
Set rs = Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = MM_bd_STRING
rs.Source = "SELECT * FROM catalogosoft WHERE id_fabricante=" & bf
rs.CursorType = 0
rs.CursorLocation = 2
rs.LockType = 1
rs.Open() ----------------------AQUI EL ERROR--------------------------------
rs_numRows = 0
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][Controlador ODBC Microsoft Access] Error de sintaxis (falta operador) en la expresión de consulta 'id_fabricante='.
Si no haces caso del error funciona perfectamente, pero no sé como quitarlo, no entiendo qué está mal.
El error da en la línea resaltada.
Espero que alguien me pueda ayudar. Muchas gracias.
<% Dim fab
Dim fab_numRows
Set fab = Server.CreateObject("ADODB.Recordset")
fab.ActiveConnection = MM_bd_STRING
fab.Source = "SELECT * FROM CatSoftFabricantes"
fab.CursorType = 0
fab.CursorLocation = 2
fab.LockType = 1
fab.Open()
fab_numRows = 0 %>
<form method="post" action="" name="clte" onSubmit="">
<select size="1" name="id" onChange="javascript:location.replace('listfab.asp?id=' + clte.id.options[clte.id.selectedIndex].value)">
<option value="todos">-Seleccionar fabricante-</option>
<%
do while not fab.eof
NombreComercial = fab("razonsocial")
Id_empresa = fab("Id_fabricante")
bs = request.querystring("id")
if bs <> "" then
if CInt(bs) = CInt(Id_empresa) then
response.write "<option value="&Id_empresa&" selected>"&NombreComercial&"</option>"
elseif CInt(bs) <> CInt(Id_empresa) then
response.write "<option value="&Id_empresa&">"&NombreComercial&"</option>"
end if
else
response.write "<option value="&Id_empresa&">"&NombreComercial&"</option>"
end if
fab.movenext
loop
%>
</select>
</form>
table width="350" border="0">
<%
Dim rs
Dim rs_numRows
bf=request.QueryString("id")
Set rs = Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = MM_bd_STRING
rs.Source = "SELECT * FROM catalogosoft WHERE id_fabricante=" & bf
rs.CursorType = 0
rs.CursorLocation = 2
rs.LockType = 1
rs.Open() ----------------------AQUI EL ERROR--------------------------------
rs_numRows = 0
Valora esta pregunta


0