Hola a todos
Tengo problema porque se sale ERROR de Replace. Os indico con mas detalle
1º-
http://www.motorpoint.com/newage/gui...mpracoches.asp
2º- Selecciona una marca y modelo. Ejemplo: Audi A2. Y pulsa botón BUSCAR
3º- Aparecen las listas de modelo. Selecciona cualquier MODELO, ejemplo A” 1.4 TDI(75) y pinchalo….
4º- Y aparece error:
Microsoft VBScript runtime error '800a005e'
Invalid use of Null: 'Replace'
/newage/guiacomprador/pruebaguia.asp, line 221
El archive pruebaguia.asp, el error viene de "
foto = Replace(foto, "jpg", "gif")"
Código HTML:
<table width="750" border="0" cellspacing="0" cellpadding="0">
<tr>
<%
reg=request.querystring("regin")
Dim marca2 ' Declaro la variable
oConn.Open "DSN=motorpoint.com.nuevos2"
SQL="SELECT * FROM NUEVOS WHERE Id = "®&";"
rs.Open SQL, oConn
marca=rs.Fields("Marca")
fomo=rs.Fields("Modelo")
foto=rs.Fields("Fotos")
potencia1=rs.Fields("Potencia")
potencia2=rs.Fields("Potencia")
combusb=rs.Fields("Combustible")
tipob=rs.Fields("Tipo")
Session("Precio")=rs.Fields("Precio")
precio_ini=CLng(rs.Fields("Precio"))
precio_fin=CLng(rs.Fields("Precio"))
Session("Marca")=rs.Fields("Marca")
foto = Replace(foto, "jpg", "gif")
%>
<td width="350">
<div id="datos">
<table width="350" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="165" align="right">
<table width="165" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="85" align="left">
<div id="foto">
<%
foto=rs.fields("fotos")
for i=1 to foto
if i<10 then
%>
<img src="http://www.motorpoint.com/newage/guia_comprador_nueva/fotos_coches/<%=rs.Fields("marca")%>/0<%=i%>.jpg" border="0">
<%
end if
next
%>
</div>
</td>
<td width="80">
<font size="2" color="#006666">
<strong>
<%=marca%>
</strong>
</font>
</td>
</tr>
</table>
</td>
<td width="10"></td>
<td width="175" align="left">
<font size="2" color="#006666">
<strong>
<em>
<%=rs.Fields("version")%>
</em>
</strong>
</font>
</td>
</tr>
<tr>
<td colspan="3" height="10"></td>
</tr>
<tr>
<td align="right">
<font color="#003366"><strong>PRECIO:</strong></font>
</td>
<td></td>
<td align="left">
<font color="#FF0000" size="2">
<strong>
<%=rs.Fields("Precio")%>
</strong>
</font>
<font size="2"><strong>€</strong></font>
</td>
</tr>
<tr>
<td colspan="3" height="10"></td>
</tr>
<tr>
<td align="right">
<font color="#003366"><strong>TIPO:</strong></font>
</td>
<td></td>
<td align="left">
<%
xtipo= tipob
if xtipo = "1" then
xtipo = Replace (xtipo, "1", "Microcoches")
end if
if xtipo = "2" then
xtipo = Replace (xtipo, "2", "Urbanos")
end if
if xtipo = "3" then
xtipo = Replace (xtipo, "3", "Compactos")
end if
if xtipo = "4" then
xtipo = Replace (xtipo, "4", "Berlinas Familiares")
end if
if xtipo = "5" then
xtipo = Replace (xtipo, "5", "Berlinas Grandes")
end if
if xtipo = "6" then
xtipo = Replace (xtipo, "6", "Derlinas de Lujo")
end if
if xtipo = "7" then
xtipo = Replace (xtipo, "7", "Monovolumenes")
end if
if xtipo = "8" then
xtipo = Replace (xtipo, "8", "Coupes")
end if
if xtipo = "9" then
xtipo = Replace (xtipo, "9", "Descapotables")
end if
if xtipo = "10" then
xtipo = Replace (xtipo, "10", "Roadster")
end if
if xtipo = "11" then
xtipo = Replace (xtipo, "11", "Todoterrenos")
end if
if xtipo = "12" then
xtipo = Replace (xtipo, "12", "Pick Up")
end if
if xtipo = "13" then
xtipo = Replace (xtipo, "13", "Derivados")
end if
%>
<font color="#333333" size="2">
<strong>
<%=xtipo%>
</strong>
</font>
</td>
</tr>
<tr>
<td colspan="3" height="10"></td>
</tr>
<tr>
<td align="right">
<font color="#003366"><strong>COMBUSTIBLE:</strong></font>
</td>
<td></td>
<td align="left">
<%
xtipo= combusb
if xtipo = "G" then
xtipo = Replace (xtipo, "G", "Gasolina")
end if
if xtipo = "D" then
xtipo = Replace (xtipo, "D", "Diesel")
end if
%>
<font color="#333333" size="2">
<strong>
<%=xtipo%>
</strong>
</font>
</td>
</tr>
<tr>
<td colspan="3" height="10"></td>
</tr>
<tr>
<td align="right">
<font color="#003366"><strong>POTENCIA:</strong></font>
</td>
<td></td>
<td align="left">
<font color="#333333" size="2">
<strong>
<%=rs.Fields("Potencia")%>
</strong>
</font>
<font color="#000000">
<strong>
CV
</strong>
</font>
</td>
</tr>
<tr>
<td colspan="3" height="10"></td>
</tr>
<tr>
<td align="right">
<font color="#003366"><strong>VELOCIDAD MAXIMA:</strong></font>
</td>
<td></td>
<td align="left">
<font color="#333333" size="2">
<strong>
<%=rs.Fields("Velocidad")%>
</strong>
</font>
<font color="#000000">
<strong>
KM/H
</strong>
</font>
</td>
</tr>
<tr>
<td colspan="3" height="10"></td>
</tr>
<tr>
<td align="right">
<font color="#003366"><strong>CILINDRADA:</strong></font>
</td>
<td></td>
<td align="left">
<font color="#333333" size="2">
<strong>
<%=rs.Fields("cilindrada")%>
</strong>
</font>
<font color="#000000">
<strong>
CC
</strong>
</font>
</td>
</tr>
<tr>
<td colspan="3" height="10"></td>
</tr>
<tr>
<td align="right">
<font color="#003366"><strong>CONSUMO:</strong></font>
</td>
<td></td>
<td align="left">
<font color="#333333" size="2">
<strong>
<span title="Extraurbano">
<%=rs.Fields("Consumo1")%>
</span>/
<span title="Mixto">
<%=rs.Fields("Consumo2")%>
</span>/
<span title="Urbano">
<%=rs.Fields("Consumo3")%>
</span>
</strong>
</font>
</td>
</tr>
<tr>
<td colspan="3" height="10"></td>
</tr>
<tr>
<td align="right">
<font color="#003366"><strong>COSTO:</strong></font>
</td>
<td></td>
<td align="left">
<font color="#333333" size="2">
<strong>
<span title="10.000 Km.">
<%=round(rs.Fields("coste10"),3)%>
/</span>
<span title="20.000 Km.">
<%=round(rs.Fields("coste20"),3)%>
/</span>
<span title="30.000 Km.">
<%=round(rs.Fields("coste30"),3)%>
</span>
</strong>
</font>
</td>
</tr>
</table>
</div>
</td>
<td width="5"></td>
<td width="390" align="center">
<table border="0" cellspacing="0" cellpadding="0" width="390">
<tr>
<td align="center" valign="top" width="">
</td>
<td width="5"></td>
<td align="center" width="">
<div id="foto">
<%
foto=rs.fields("fotos")
for i=1 to foto
if i<10 then
%>
<a href="javascript:afoto('http://www.motorpoint.com/newage/guia_comprador_nueva/fotos_coches/<%=rs.Fields("marca")%>/<%=rs.Fields("modelo")%>/0<%=i%>.jpg')">
<img src="http://www.motorpoint.com/newage/guia_comprador_nueva/fotos_coches/<%=rs.Fields("marca")%>/<%=rs.Fields("modelo")%>/0<%=i%>.jpg" width="200" border="0">
</a>
<%else%>
<a href="javascript:afoto('http://www.motorpoint.com/newage/guia_comprador_nueva/fotos_coches/<%=rs.Fields("marca")%>/<%=rs.Fields("modelo")%>/0<%=i%>.jpg')">
<img src="http://www.motorpoint.com/newage/guia_comprador_nueva/fotos_coches/<%=rs.Fields("marca")%>/<%=rs.Fields("modelo")%>/0<%=i%>.jpg" width="200" border="0">
</a>
<br>
<%
end if
next
%>
</div>
Me podriasi ayudar esta solucion lo antes posible!!!
Por favor y gracias