Sono di nuovo qui per chiedervi... se qualcuno è in grado di dirmi perchè non funziona questo:
Qui potete provare il mio esempio e verificare che non funziona la seconda SELECT
Mentre qui potete scaricare il database di prova se volete testarlo voi
File "config.asp"
codice:
<%
Option Explicit
' On Error Resume Next
Response.Buffer = True
' ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
Dim titolo
titolo = "Prova"
' ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
Dim var_username, var_password
var_username = "admin"
var_password = "admin"
' ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
Dim sc
sc = "driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("\mdb-database\database.mdb")
' ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
%>
File "richiesta_ass.asp"
codice:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
'If Session("admin") <> "OK" Then Response.Redirect "index.asp"
Dim cn, rs
Set cn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
cn.Open sc
%>
<html>
<head>
<LINK href="/utilities_marco/verdana.css" type="text/css" rel="stylesheet">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Assistenza Thera</title>
<style type="text/css">
<!--
TABLE,LEGEND,INPUT
{
font-family:"Trebuchet MS", Verdana, sans-serif; font-size:12px;
}
select {font-family:Verdana, Arial, sans-serif; font-size:10px;}
-->
</style>
<link href="formattazione.css" type="text/css" rel="stylesheet">
</head>
<body>
<tr>
<td width="40%">Utente</td>
<td width="60%">
<select onchange="location.href='richiesta_ass.asp?id=' + this.value" style="width: 100%;">
<option value="">Seleziona il tuo Nome Utente</option>
<%
rs.Open "SELECT * FROM utenti", cn, 1
While rs.EOF = False
%>
<option value="<%=rs("id")%>"><%Response.Write rs("nome") & " " & rs("cognome")%></option>
<%
rs.MoveNext
Wend
rs.Close
%>
</select>
</td>
</tr>
<tr height "30">
<td> </td>
</tr>
<%
Dim id
id = Request.QueryString("id")
If Len(Trim(id)) > 0 Then
Dim utente
Set utente = cn.Execute("SELECT * FROM utenti WHERE id = " & id)
%>
<input type="hidden" name="id_cont" value="<%=utente("id")%>">
<tr>
<td>Nome</td>
<td><input type="text" name="nome" maxlength="50" style="width: 100%;" value="<%=utente("nome")%>"></td>
</tr>
<tr>
<td>Cognome</td>
<td><input type="text" name="cognome" maxlength="50" style="width: 100%;" value="<%=utente("cognome")%>"></td>
</tr>
<tr>
<td>Nomeutente</td>
<td><input type="text" name="nomeutente" maxlength="50" style="width: 100%;" value="<%=utente("nomeutente")%>"></td>
</tr>
<%
Set utente = Nothing
End If
%>
<tr>
<td width="40%">Hardware</td>
<td width="60%">
<select onchange="location.href='richiesta_ass.asp?id=<%=id%>&' + this.value" style="width: 100%;">
<option value="">Seleziona l'hardware guasto</option>
<%
rs.Open "SELECT * FROM hardware", cn, 1
While rs.EOF = False
%>
<option value="<%=rs("id_hardware")%>"><%Response.Write rs("apparecchiatura") & " " & rs("modello")%></option>
<%
rs.MoveNext
Wend
rs.Close
%>
</select>
</td>
</tr>
<tr height "30">
<td> </td>
</tr>
<%
Dim id_hard
id_hard = Request.QueryString("id_hardware")
If Len(Trim(id_hard)) <> 0 Then
Dim hardwarelist
Set hardwarelist = cn.Execute("SELECT * FROM hardware WHERE id_hardware = " & id_hard)
%>
<input type="hidden" name="id_hardware_cont" value="<%=hardwarelist("id_hardware")%>">
<tr>
<td>Apparecchiatura</td>
<td><input type="text" name="apparecchiatura" style="width: 100%;" value="<%=hardwarelist("apparecchiatura")%>"></td>
</tr>
<tr>
<td>Modello</td>
<td><input type="text" name="modello" style="width: 100%;" value="<%=hardwarelist("modello")%>"></td>
</tr>
<%
Set hardwarelist = Nothing
End If
%>
</body>
</html>
<%
Set rs = Nothing
cn.Close
Set cn = Nothing
%>
GRAZIE in anticipo a chiunque vorrà aiutarmi