ciao a tutti,
nel il mio sito ho una galleria immagini, cliccando sulle miniature si accede alla pagina con la foto grande ed i dettagli .Adesso vorrei inserire anche eventuali commenti lasciati dagli utenti.
Per questo motivo mi sono organizzato con due database:
nel primo (viaggi.db) ho i dati relativi alle immagini
foto_id
titolo
categoria
foto
fotogrande
data
formato
nel secondo (commenti.db) invece
commento_id
commento
nome
foto_id
Da entrambe i database poi scrivo a video quanto mi serve, la prima parte della pagina dedicata alla foto+
dettagli , la seconda parte invece dedicata ai commenti.
La parte relativa all'immagine funziona con un qualcosa del tipo scheda.asp?foto_id=xxxx , quindi pensavo di
usare lo stesso concetto anche per i commenti. L'utente attraverso il form per il commento invia nel database
commenti anche foto_id , che mi serve dopo per dividere i commenti a seconda dell'immagine a cui sono riferiti
Spero di non essere stato chiaro,nonostante mi senta perso, comunque il problema è che LA PARTE RELATIVA AI COMMENTI non funziona !!!!
L'errore che mi restituisce è
ADODB.Recordset error '800a0e7d'
The connection cannot be used to perform this operation. It is either closed or invalid in this context.
/scheda2.asp, line 375
Posto il codice per una migliore
comprensione , sperando che qualcuno possa aiutarmi .
Grazie in anticipo..
<%
Dim id1
id1=request.querystring("foto_id")
Dim Conn
Set Conn = Server.CreateObject("ADODB.Connection")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & server.mappath("/mdb-database/db2.mdb")
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "select * from viaggi where foto_id like "&id1, conn
Do while NOT RS.EOF
%>
<html>
<head>
</head>
<body link="#000000" vlink="#000000" alink="#000000">
<div id="content">
<table border="0" width="410px">
<tr>
<td width="100%" bgcolor="#CCCCCC">
<table border="0" width="100%">
<tr>
<td width="100%" colspan="4"><%Response.Write("[img]images/" & RS("fotogrande") & "[/img]") %></td>
</tr>
<tr>
<td width="100%" colspan="4"><font face="Verdana" size="1">Descrizione:<% response.write"" & RS("descrizione") & " "%></font></td>
</tr>
<tr>
<td width="25%"><font face="Verdana" size="1">viaggio</font></td>
<td width="25%"><font face="Verdana" size="1"><% response.write"" & RS("categoria") & " "%></font></td>
<td width="25%"><font face="Verdana" size="1">dimensioni</font></td>
<td width="25%"><font face="Verdana" size="1"><% response.write"" & RS("formato") & " "%></font></td>
</tr>
<tr>
<td width="25%"><font face="Verdana" size="1">tema</font></td>
<td width="25%"><font face="Verdana" size="1"><% response.write"" & RS("viaggio") & " "%></font></td>
<td width="25%"><font face="Verdana" size="1">voto</font></td>
<td width="25%"><font face="Verdana" size="1"><% response.write"" & RS("categoria") & " "%></font></td>
</tr>
<tr>
<td width="25%"><font face="Verdana" size="1">titolo</font></td>
<td width="25%"><font face="Verdana" size="1"><% response.write"" & RS("titolo") & " "%></font></td>
<td width="25%"><font face="Verdana" size="1">desktop</font></td>
<td width="25%"><font face="Verdana" size="1"><% response.write"" & RS("categoria") & " "%></font></td>
</tr>
<tr>
<td width="25%"><font face="Verdana" size="1">data</font></td>
<td width="25%"><font face="Verdana" size="1"><% response.write"" & RS("data") & " "%></font></td>
<td width="25%"><font face="Verdana" size="1">prezzo</font></td>
<td width="25%"><font face="Verdana" size="1"><% response.write"" & RS("categoria") & " "%></font></td>
</tr>
</table>
</td>
</tr>
</table>
<%
RS.MoveNext
Loop
RS.Close
Set RS = Nothing
conn.Close
Set conn=Nothing
%>
<%
Dim id2
id2=request.querystring("foto_id")
Dim Con
Set Con = Server.CreateObject("ADODB.Connection")
con.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & server.mappath("/mdb-database/db2.mdb")
Dim rss
Set rss = Server.CreateObject("ADODB.Recordset")
rss.Open " SELECT commento FROM commenti, viaggi WHERE commenti.foto_id=viaggi.foto_id AND viaggi.foto_id= "&id2, con
Do while NOT RSS.EOF
%>
<P align= "center" >
<table border="0" width="410px">
<tr>
<td width="100%">
<table border="0" width="100%">
<tr>
<td width="33%"><font size="2" face="Verdana">"<% response.write"" & RSS("nome") & " "%>"</font></td>
<td width="33%"><font size="2" face="Verdana">"<% response.write"" & RSS("email") & " "%>"</font></td>
<td width="34%">3</td>
</tr>
<tr>
<td width="100%" colspan="3"><font size="2" face="Verdana">"<% response.write"" & RSS("commento") & " "%>"</font></td>
</tr>
</table>
</td>
</tr>
</table>
<%
RSS.MoveNext
Loop
RSS.Close
Set RSS = Nothing
con.Close
Set con=Nothing
%>
ADODB.Recordset error '800a0e7d'
The connection cannot be used to perform this operation. It is either closed or invalid in this context.
/scheda2.asp, line 375