Gemmer ikke querystring!
HejsaJeg er i gang med at opdatere min hjemmeside og lige nu (den seneste uge) har jeg arbejdede på et problem med, at implicere 2 egen moduler til Skyportal, alt er næsten løst, men når jeg login fra en side eks.
http://www.lystfiskerens.net/fisk/vis.asp?rid=71&t=Kyst%20endegrej
|
\/
login
|
\/
http://www.lystfistkerens.net/fisk/vis.asp
taber jeg querystring - script kører fint selvstædig, jeg kan "bare" ikke lige finde ud af hvor problemet er!!!
Jeg får denne fejl ved login
//Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'id ='.
/fisk/vis.asp, line 236
//
//vis.asp//
<%
dim mode, id
strDSN = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ="&Server.MapPath("jerg.mdb")
Set myConn = Server.CreateObject("ADODB.Connection")
myConn.Open strDSN
id = Request("rid")
%>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="logo">
<tr>
<td>
<tr>
<td valign="top" >
<div align="left">
<% Response.Write "<H2>" & "</H2>"
spThemeTitle= "Anmeldelse"
spThemeBlock1_open(intSkin) %>
</div>
<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath ("jerg.mdb")
strUpdate = "UPDATE anm SET visninger = visninger + 1 WHERE id = "& request.querystring("rid") &""
Conn.Execute(strUpdate)
strSQL = "SELECT * From anm where id = " & id
Set rs = myConn.Execute(strSQL)%>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="logo">
<tr>
<td>
<tr>
<td valign="top" >
<div align="left">
<table width="80%" border="0" align="center" cellpadding="4" cellspacing="4">
<tr>
<td> </td>
</tr>
<tr>
<td height="16" bgcolor="#E4E4E4" class="ramme"> <div align="left">
<%
'Så kan du checke om "t" er "butik" eller "grej":
dim t
t = LCase(request.querystring("t"))
' LCase betyder at den skal check småbogstaver, da der er forskel på butik, buTIK, BUtik, osv..
Select Case t
case "grejbutik"
' udfør kode der har med "butik" at gøre
response.write "<div align='left'>"
response.write"<table width=100% border=0 bgcolor=#E4E4E4 cellpadding=8 >"
response.write"<tr>"
response.write"<td>"
response.write"<b> </b>"
response.write"</td>"
response.write"<td>"
response.write " "
response.write"</td>"
response.write"<td >"
response.write "<font size=2>" & "læst:" & " " & rs("visninger") & " </font> "
response.write"</td>"
response.write"<tr>"
response.write"<td>"
response.write"<b> Indsendt af:</b>"
response.write"</td>"
response.write"<td>"
response.write rs("MEMBER_ID") & " " & "den" & " " & rs("dato")
response.write"</td>"
response.write"<tr>"
response.write"<td>"
response.write"<b> Butik:</b>"
response.write"</td>"
response.write"<td>"
response.write rs("butik")
response.write"</td>"
response.write"<tr>"
response.write"<td>"
response.write"<b> By:</b>"
response.write"</td>"
response.write"<td>"
response.write rs("by")
response.write"</td>"
link_url = rs("urlbutik")
if link_url<>"" then
response.write"<tr>"
response.write"<td>"
response.write"<b> Hjemmeside:</b>" & " " & " " & " " & " "
response.write"</td>"
response.write"<td>"
response.write "<a href=" & link_url & " target='_blank'" & ">Besøg siden</a>"
response.write"</td>"
end if
response.write"<tr>"
response.write"<td>"
response.write"<b> Faglig ekspertise:</b>"
response.write"</td>"
response.write"<td>"
for i = 1 to CInt(rs("faglig"))
response.write "<img src=""orange.gif"" alt=""Stjerne"">"
next
response.write"</td>"
response.write"<tr>"
response.write"<td>"
response.write"<b> Kundeservice:</b>"
response.write"</td>"
response.write"<td>"
for i = 1 to CInt(rs("kunde"))
response.write "<img src=""orange.gif"" alt=""Stjerne"">"
next
response.write"</td>"
response.write"<tr>"
response.write"<td>"
response.write"<b> Udvalg:</b>"
response.write"</td>"
response.write"<td>"
for i = 1 to CInt(rs("udvalg"))
response.write "<img src=""orange.gif"" alt=""Stjerne"">"
next
response.write"</td>"
response.write"<tr>"
response.write"<td valign=top>"
response.write"<b> Bemærkning:</b>"
response.write"</td>"
response.write"<td>"
response.write Replace(rs("beskrivelse"),vbCrLf,"<br>")
response.write"</td>"
response.write"<tr>"
response.write"<td>"
response.write"<b></b>"
response.write"</td>"
response.write"<td>"
Response.Write "<a href=""java script:openWindow4('kommen.asp?rid="&id&"')""><font color=""#FF0000"">Tilføj en kommentar til anmeldelsen</font> </a>"
response.write"</td>"
response.write"</tr>"
response.write "</table>"
response.write "</div>"
case else
' udfør kode der har med "butik" at gøre
response.write "<div align='left'>"
response.write"<table width=""80%"" border=""0"" bgcolor=""#E4E4E4"" cellpadding=""8"" >"
alt_pic = rs("produkt")
response.write"<tr>"
response.write"<td>"
response.write"<b> </b>"
response.write"</td>"
response.write"<td>"
response.write " "
response.write"</td>"
response.write"<td>"
response.write "<font size=2>" & "læst:" & " " & rs("visninger") & " </font> "
response.write"</td>"
response.write"<tr>"
response.write"<td>"
response.write"<b> Produkt:</b>"
response.write"</td>"
response.write"<td>"
response.write (alt_pic)
response.write"</td>"
response.write"<tr>"
response.write"<td>"
response.write"<b> Indsendt af:</b>"
response.write"</td>"
response.write"<td>"
response.write rs("MEMBER_ID") & " " & "den" & " " & rs("dato")
response.write"</td>"
response.write"<tr>"
response.write"<td>"
response.write"<b> Anslået antal ture:</b>"
response.write"</td>"
response.write"<td>"
response.write rs("ture")
response.write"</td>"
response.write"<tr>"
response.write"<td>"
response.write"<b> Karakter:</b>"
response.write"</td>"
response.write"<td>"
for i = 1 to CInt(rs("karakter"))
response.write "<img src=""orange.gif"" alt=""Stjerne"">"
next
response.write"</td>"
response.write"<tr>"
response.write"<td valign=top>"
response.write"<b> Bedømmelse:</b>"
response.write"</td>"
response.write"<td>"
response.write Replace(rs("beskrivelse"),vbCrLf,"<br>")
response.write"</td>"
response.write"<tr>"
response.write"<td>"
response.write"<b> Pris:</b>"
response.write"</td>"
response.write"<td>"
response.write rs("pris")
response.write"</td>"
response.write"<tr>"
response.write"<td>"
response.write"<b> </b>"
response.write"</td>"
response.write"<td>"
billed_url = rs("url")
if billed_url<>"" then
Response.write "<br>" & "<br>" & "<img src='" & billed_url & "' alt=""" & (alt_pic) & """ title=""" & (alt_pic) & """>"
end if
billed_url = rs("billede")
if billed_url<>"" then
Response.write "<img src='" & "thumbnails450" & "/" & Mid(billed_url,10) & "' class=""rammesort"" alt=""" & (alt_pic) & """ title=""" & (alt_pic) & """ >"
end if
response.write"</td>"
response.write"<tr>"
response.write"<td>"
response.write"<b></b>"
response.write"</td>"
response.write"<td>"
if (hasAccess(2)) then
Response.Write "<a href=""java script:openWindow4('kommen.asp?rid="&id&"')""><font color=""#FF0000"">Tilføj en kommentar til anmeldelsen</font> </a>"
else
response.write"<font color=""#FF0000"">Ønsker Du at tilføj en kommentar - så login!</font>"
end if
response.write"</td>"
response.write"</tr>"
response.write "</table>"
response.write "</div>"
end select
%>
</div></td>
</tr>
</table>
<div align="center"><br>
<table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> <p align="center"><strong><font size="3" face="Verdana, Arial, Helvetica, sans-serif">Kommentarer
:</font></strong> </p>
<p align="center"> </p>
<p>
<%' HER ER VISNING SIDEN
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath ("jerg.mdb")
strSQL = "Select * from kommen where kategori="&request.querystring("rid")
set rs = Conn.execute(strSQL)
if rs.EOF then
Response.write ""
else
Do Until rs.EOF
dim kategori
kategori = rs("kategori")
%>
<table width="100%" cellpadding="10" bgcolor="#E4E4E4" class="ramme">
<tr>
<td width="250" valign="top" bgcolor="#E4E4E4"> <b>Tilføjet af:</b>
<% = rs("kommennavn") %><br> <b>Dato:</b> <%=RS("kommendato")%><br> </td>
<td valign="top" bgcolor="#FFFFFF"> <%=RS("besked")%><br> </td>
</tr>
</table>
<div align="left"><br>
</div>
<%RS.MoveNext
Loop
end if
Conn.Close
Set Conn = Nothing%>
<tr>
<td> <%' HER ER FORMSIDEN
DBPATH = "DBQ=" & Server.MapPath("jerg.mdb") & ";Driver={Microsoft Access Driver (*.mdb)}"
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open DBPATH
If Request.QueryString("mode") = "new" Then
navn = ChkString(Request.Form("navn"))
besked1 = ChkString(Request.Form("besked"))
besked1 = ChkString(Replace(besked1, "'", "''"))
besked1 = ChkString(Replace(besked1, vbCrLf, "<br>"))
besked = besked1
kategori=ChkString(request.querystring("rid"))
If navn="" Or besked="" then
Response.Write "<b>Du skal udfylde alle felter!</b>"
Else
strSQL="INSERT INTO kommen (kommennavn,besked,kategori,kommendato) VALUES('" & navn & "','" & besked & "'," & kategori & ",'" & day(now) & "-" & month(now) & "-" & year(now) & "' )"
Conn.Execute(strSQL)
'og så lige lidt orden, måske ;)
conn.close
set conn=nothing
'og SÅ:
response.redirect "tak.htm" End If
End If
Set Conn = Nothing
%>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
<%
spThemeBlock1_close(intSkin)