Hej, ja har problem me en fil som ja tror segar ner hela sidan, men jag hittar inget fel, gör ni? Har gått igenom din kod. Kanske fortfarande inte fungerar. Men städat upp några fel i alla fall. tack för hjälpen, men ja får ett fel när ja ska köra filen på rad 41 Ändra :kod fel? need help...
så här ser filen ut:
<%
NyhetPerSida = 4 ' Antal nyhetsrubriker per sida
URL = "kellef_artiklar.asp" ' Sidan du inkluderar news.asp i
db = Server.MapPath("artiklar/db/news.mdb") ' Databasens sökväg
Width = "200" ' Bredd på bilden
%>
<body bgcolor="#CC9966" topmargin="0">
<table width="105" border="0" cellpadding="0" cellspacing="0" height="125">
<tr>
<td colspan="3" height="2"><img src="tabell/top.gif" width="135" height="9"></td>
</tr>
<tr>
<td width="9" bgcolor="#990000" background="tabell/v.gif" height="105" rowspan="2"> </td>
<td width="134" bgcolor="#CC9966" valign="top" height="2" class="whiteLink"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#FFFFCC"><b><font color="#990000">::
Nya Artiklar</font></b></font></td>
<td bgcolor="99000" width="9" background="tabell/h.gif" height="105" rowspan="2"> </td>
</tr>
<tr>
<td width="134" bgcolor="#CC9966" valign="top" height="53" class="whiteLink">
<table cellpadding="1" cellspacing="0" width="100%" border="0" height="130">
<%Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & db
If Request.QueryString("aid") = "" Then
Set RecSet = Server.CreateObject("ADODB.Recordset")
Sidan = Request.QueryString("sida")
If Sidan = "" then
sida = 1
Else
sida = Sidan
End If
With RecSet
.CursorLocation = 3
.CacheSize = NyhetPerSida
End With
SQL = "SELECT * FROM news Order By aid desc"
RecSet.Open SQL, Conn
If RecSet.EOF Then
RS.Close
Conn.Close%>
<tr>
<td width="41"><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000" size="1">Inga
nyheter inlagda!</font></td>
</tr>
<%Else
With RecSet
.MoveFirst
.PageSize = NyhetPerSida
.AbsolutePage = sida
End With
Sidor = RecSet.PageCount
x = 0
Do While Not RecSet.EOF And x < RecSet.PageSize %>
<tr>
<td colspan="2" valign="top">">
<%=RecSet("rubrik")%></td>
</tr>
<%x=x+1
RecSet.MoveNext
Loop
RecSet.Close
If Sidor > 1 Then%>
<%End If
End If
End If
If Request.QueryString("aid") <> "" Then
Set RS=Conn.Execute("Select * From news Where aid=" & Request.QueryString("aid"))
RS.Close
Conn.Close%>
<%End If%>
</table>
</td>
</tr>
<tr>
<td height="2" width="9"><img src="tabell/nedkantv.gif" width="9" height="12"></td>
<td background="tabell/kantned.gif" height="2" width="134"><img src="file:///F|/KeLLeF%20OnLine%203/pixel.gif" width="2" height="4"></td>
<td height="2" width="9"><img src="tabell/nedkanth.gif" width="9" height="12"></td>
</tr>
</table>Sv: kod fel? need help...
<code>
<%
Option Explicit
Const NyhetPerSida = 4 ' Antal nyhetsrubriker per sida
Const URL = "kellef_artiklar.asp" ' Sidan du inkluderar news.asp i
Const Width = "200" ' Bredd på bilden
Dim db
db = Server.MapPath("artiklar/db/news.mdb") ' Databasens sökväg
%>
<body bgcolor="#CC9966" topmargin="0">
<table width="105" border="0" cellpadding="0" cellspacing="0" height="125">
<tr>
<td colspan="3" height="2"><img src="tabell/top.gif" width="135" height="9"></td>
</tr>
<tr>
<td width="9" bgcolor="#990000" background="tabell/v.gif" height="105" rowspan="2"> </td>
<td width="134" bgcolor="#CC9966" valign="top" height="2" class="whiteLink"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#FFFFCC"><font color="#990000">::
Nya Artiklar</font></font></td>
<td bgcolor="99000" width="9" background="tabell/h.gif" height="105" rowspan="2"> </td>
</tr>
<tr>
<td width="134" bgcolor="#CC9966" valign="top" height="53" class="whiteLink">
<table cellpadding="1" cellspacing="0" width="100%" border="0" height="130">
<%
Dim aid
Dim sida
Dim Sidan
Dim strSQL
Dim Conn
Dim RecSet
aid = Request.QueryString("aid")
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & db
If IsNumeric(aid) Then
Set RecSet = Conn.Execute("SELECT * FROM news WHERE aid = " & aid)
%>
<%
RecSet.Close
Else
Sidan = CStr(Request.QueryString("sida"))
If Sidan = "" then
sida = 1
Else
sida = Sidan
End If
Set RecSet = Server.CreateObject("ADODB.Recordset")
RecSet.PageSize = NyhetPerSida
RecSet.CursorLocation = 3
RecSet.CacheSize = NyhetPerSida
strSQL = "SELECT * FROM news ORDER BY aid DESC"
RecSet.Open SQL, Conn
If RecSet.EOF Then
%>
<tr>
<td width="41"><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000" size="1">Inga
nyheter inlagda!</font></td>
</tr>
<%
Else
RecSet.AbsolutePage = sida
Sidor = RecSet.PageCount
x = 0
Do Until RecSet.EOF Or x >=NyhetPerSida
%>
<tr>
<td colspan="2" valign="top">">
<%=RecSet("rubrik")%></td>
</tr>
<%
x=x+1
RecSet.MoveNext
Loop
If Sidor > 1 Then
%>
<%
End If
End If
RecSet.Close
End If
Conn.Close
%>
</table>
</td>
</tr>
<tr>
<td height="2" width="9"><img src="tabell/nedkantv.gif" width="9" height="12"></td>
<td background="tabell/kantned.gif" height="2" width="134"><img src="file:///F|/KeLLeF%20OnLine%203/pixel.gif" width="2" height="4"></td>
<td height="2" width="9"><img src="tabell/nedkanth.gif" width="9" height="12"></td>
</tr>
</table>
</code>Sv: kod fel? need help...
Feltyp:
Microsoft JET Database Engine (0x80040E14)
Syntaxfel (operator saknas) i frågeuttrycket 'aid ='.
/artiklar/topp2.asp, line 41
RAD 41 ser ut såhär..
Set RecSet = Conn.Execute("SELECT * FROM news WHERE aid =" & aid) Sv: kod fel? need help...
<code>
aid = Request.QueryString("aid")
</code>
Till:
<code>
aid = "" & Request.QueryString("aid")
</code>