La pagina è in asp, e so collega al Db con
RecTipologia.ActiveConnection = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ="&ServerPath&"\euroscooter.mdb"
questo è il codice:
--------------------------------------
<%@LANGUAGE="VBSCRIPT"%>
<%
tipo = request("tipo")
marca= request("marca")modello = request("modello")
%>
<script language="javascript">
var liveSearchReq;
function cercatipo()
{
//document.write("1");
//var valorecampo = document.MOTOIT_Form1.EMARCA.options[document.MOTOIT_Form1.EMARCA.selectedIndex].value;
// branch for native XMLHttpRequest object
if (window.XMLHttpRequest) {
//document.write("2");
liveSearchReq = new XMLHttpRequest();
//document.write("3");
liveSearchReq.onreadystatechange = ricevitipo;
//document.write("4");
liveSearchReq.open("GET", "tiponuovo.asp",true);
//document.write("5");
liveSearchReq.send(null);
// document.write("6");
// branch for IE/Windows ActiveX version
} else if (window.ActiveXObject) {
//document.write("7");
liveSearchReq = new ActiveXObject("Microsoft.XMLHTTP");
if (liveSearchReq) {
//document.write("8");
liveSearchReq.onreadystatechange = ricevitipo;
// document.write("9");
liveSearchReq.open("GET", "tiponuovo.asp",true); //document.write("10");
liveSearchReq.send(); //document.write("11");
}
}
}
function ricevitipo() {
//document.write("10");
var strRes;
var arrValori;
//document.write(liveSearchReq);
if (liveSearchReq.readyState == 4) {
// document.write(liveSearchReq.responseText);
strRes=liveSearchReq.responseText;
//document.write(strRes);
arrValori=strRes.split("||");
//document.write(arrValori);
//document.form1.tipo.options.length=0;
for(i=1;i<arrValori.length-1;i++)
{
/* document.form1.tipo.options[document.form1.tipo.options.length]= new Option(arrValori[i].split("|")[1],arrValori[i].split("|")[0]); */
arrValori[i-1]=arrValori[i];
}
for(i=0;i<arrValori.length-2;i++)
{
/* document.form1.tipo.options[document.form1.tipo.options.length]= new Option(arrValori[i].split("|")[1],arrValori[i].split("|")[0]); */
document.form1.tipo.options[i]= new Option(arrValori[i]);
}
}
}
var liveSearchReq1;
function cercamarca()
{
var valorecampo = document.form1.tipo.options[document.form1.tipo.selectedIndex].value;
//document.write(valorecampo);
//var valorecampo = document.MOTOIT_Form1.EMARCA.options[document.MOTOIT_Form1.EMARCA.selectedIndex].value;
// branch for native XMLHttpRequest object
if (window.XMLHttpRequest) {
//document.write("2");
liveSearchReq1 = new XMLHttpRequest();
//document.write("3");
liveSearchReq1.onreadystatechange = ricevimarca;
//document.write("4");
liveSearchReq1.open("GET", "marcanuovo.asp?tipo="+valorecampo,true);
//document.write("5");
liveSearchReq1.send(null);
//document.write("hhhhhhh6");
//document.write(valorecampo);
// branch for IE/Windows ActiveX version
} else if (window.ActiveXObject) {
//document.write("7");
liveSearchReq1 = new ActiveXObject("Microsoft.XMLHTTP");
if (liveSearchReq1) {
//document.write("8");
liveSearchReq1.onreadystatechange = ricevimarca;
//document.write("9");
liveSearchReq1.open("GET", "marcanuovo.asp?tipo="+valorecampo,true);// document.write("10");
liveSearchReq1.send();// document.write("11");
}
}
}
function ricevimarca() {
//document.write("10");
var strRes;
var arrValori;
//document.write(liveSearchReq);
//document.write(liveSearchReq1);
if (liveSearchReq1.readyState == 4) {
strRes=liveSearchReq1.responseText;
//document.write(strRes);
arrValori=strRes.split("||");
//document.write(arrValori);
//document.form1.tipo.options.length=0;
for(i=1;i<arrValori.length-1;i++)
{
/* document.form1.tipo.options[document.form1.tipo.options.length]= new Option(arrValori[i].split("|")[1],arrValori[i].split("|")[0]); */
arrValori[i-1]=arrValori[i];
//document.write(arrValori[i]);
}
for(i=0;i<arrValori.length-2;i++)
{
/* document.form1.tipo.options[document.form1.tipo.options.length]= new Option(arrValori[i].split("|")[1],arrValori[i].split("|")[0]); */
document.form1.marca.options[i]= new Option(arrValori[i]);
}
}
}
var liveSearchReq2;
function cercamodello()
{
var valorecampo = document.form1.tipo.options[document.form1.tipo.selectedIndex].value;
var valorecampo2 = document.form1.marca.options[document.form1.marca.selectedIndex].value;
//document.write(valorecampo);
//var valorecampo = document.MOTOIT_Form1.EMARCA.options[document.MOTOIT_Form1.EMARCA.selectedIndex].value;
// branch for native XMLHttpRequest object
if (window.XMLHttpRequest) {
//document.write("2");
liveSearchReq2 = new XMLHttpRequest();
//document.write("3");
liveSearchReq2.onreadystatechange = ricevimodello;
//document.write("4");
liveSearchReq2.open("GET", "modellonuovo.asp?tipo="+valorecampo+"&marca="+val orecampo2,true);
//document.write("5");
liveSearchReq2.send(null);
//document.write("hhhhhhh6");
//document.write(valorecampo);
// branch for IE/Windows ActiveX version
} else if (window.ActiveXObject) {
//document.write("7");
liveSearchReq2 = new ActiveXObject("Microsoft.XMLHTTP");
if (liveSearchReq2) {
//document.write("8");
liveSearchReq2.onreadystatechange = ricevimodello;
//document.write("9");
liveSearchReq2.open("GET", "modellonuovo.asp?tipo="+valorecampo+"&marca="+val orecampo2,true);
liveSearchReq2.send();// document.write("11");
}
}
}
function ricevimodello() {
//document.write("10");
var strRes;
var arrValori;
//document.write(liveSearchReq);
//document.write(liveSearchReq1);
if (liveSearchReq2.readyState == 4) {
strRes=liveSearchReq2.responseText;
//document.write(strRes);
arrValori=strRes.split("||");
//document.write(arrValori);
//document.form1.tipo.options.length=0;
for(i=1;i<arrValori.length-1;i++)
{
/* document.form1.tipo.options[document.form1.tipo.options.length]= new Option(arrValori[i].split("|")[1],arrValori[i].split("|")[0]); */
arrValori[i-1]=arrValori[i];
//document.write(arrValori[i]);
}
for(i=0;i<arrValori.length-2;i++)
{
/* document.form1.tipo.options[document.form1.tipo.options.length]= new Option(arrValori[i].split("|")[1],arrValori[i].split("|")[0]); */
document.form1.modello.options[i]= new Option(arrValori[i]);
}
}
}
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento senza titolo</title>
<style type="text/css">
<!--
body {
background-image: url();
}
.Stile1 {
color: #FFFFFF;
font-weight: bold;
}
.Stile3 {color: #FFFFFF; font-weight: bold; font-size: large; }
.Stile7 {color: #CC0000}
.Stile9 {color: #CC0000; font-weight: bold; font-size: large; }
-->
</style></head>
<body bgcolor="#000000">
<%'C:\Inetpub\wwwroot\Euroscooter\ '"&ServerPath&"
if (request("modello") <> "") then
set RecTipologia = Server.CreateObject("ADODB.Recordset")
'ServerPath =Server.MapPath ("Euroscooter\euroscooter.mdb")
'RecTipologia.ActiveConnection = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ="&Server.MapPath ("./euroscooter.mdb")
ServerPath =Server.MapPath (".")
RecTipologia.ActiveConnection = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ="&ServerPath&"\euroscooter.mdb"
RecTipologia.Source = "SELECT * FROM nuovo WHERE tipo='"+tipo+"' AND marca='"+marca+"' AND modello='"+modello+"'"
RecTipologia.CursorType = 0
RecTipologia.CursorLocation = 2
RecTipologia.LockType = 3
RecTipologia.Open()
' *** Move To Record and Go To Record: declare variables
RecTipologia.MoveFirst
end if
%>
<table width="895" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="130" colspan="5" valign="top">[img]img/header.jpg[/img]</td>
</tr>
<tr>
<td height="20" colspan="5" valign="top"><object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="100" height="20">
<param name="movie" value="BT-home.swf" />
<param name="quality" value="high" />
<embed src="BT-home.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="100" height="20"></embed>
</object>
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="100" height="20">
<param name="movie" value="BT-nuovo.swf" />
<param name="quality" value="high" />
<embed src="BT-nuovo.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="100" height="20"></embed>
</object>
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="100" height="20">
<param name="movie" value="BT-usato.swf" />
<param name="quality" value="high" />
<embed src="BT-usato.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="100" height="20"></embed>
</object>
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="100" height="20">
<param name="movie" value="BT-abbigliamento.swf" />
<param name="quality" value="high" />
<embed src="BT-abbigliamento.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="100" height="20"></embed>
</object>
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="100" height="20">
<param name="movie" value="BT-accessori.swf" />
<param name="quality" value="high" />
<embed src="BT-accessori.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="100" height="20"></embed>
</object>
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="375" height="20">
<param name="movie" value="superiore.swf" />
<param name="quality" value="high" />
<embed src="superiore.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="375" height="20"></embed>
</object></td>
</tr>
<tr>
<td height="47" colspan="5" valign="top"><object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="895" height="47">
<param name="movie" value="passionenuovo.swf" />
<param name="quality" value="high" />
<embed src="passionenuovo.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="895" height="47"></embed>
</object></td>
</tr>
<tr>
<td width="279" rowspan="11" valign="top">
<form id="form1" method="get" action="m-nuovo1.asp" name="form1" >
<label><span class="Stile7">
</span><span class="Stile9">
Tipo</span><span class="Stile7">
</span>
<select name="tipo" onfocus="cercamarca()" onchange="cercamarca()" >
</select >
</label>
.................................
non entra tutto..
--------------------------------------------------------------------