Guest_imported
New member
- Jan 1, 1970
- 0
Hi... I wrote this banner script for a friend:
===========================================================
<!--#include file="adovbs.inc"-->
<%
strConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("/mattfest/db/banners.mdb" & ";"
Set Conn = Server.CreateObject("ADODB.Connection"
Conn.Open strConnectionString
sqltemp = "SELECT * FROM Banners"
SET rsTemp = Server.CreateObject("adodb.Recordset"
rsTemp.open sqltemp, Conn, adopenstatic
IF Request.Cookies("banners"("adnum" = "" THEN
CurrentBanner = "1"
ELSE
CurrentBanner = Request.Cookies("banners"("adnum"
END IF
sqlBanners = "SELECT * FROM Banners WHERE ID = " & CurrentBanner
rsBanners = Conn.Execute(sqlBanners)
Response.Write "<a href=""" & rsBanners("URL" & """ target=""_blank""><img src=""" & rsBanners("Image" & """ border=""0"" alt=""" & rsBanners("Name" & """></a>"
IF CurrentBanner = TotalBanners THEN
Response.Cookies("banners"("adnum" = "1"
ELSE
Response.Cookies("banners"("adnum" = CurrentBanner + 1
END IF
%>
============================================================
It will go through the banner rotation, but when it's done, it gives me this:
ADODB.Field error '80020009'
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
/mattfest/banners.asp, line 0
I don't know what's wrong... Can you guys help? Thanks in advance!
===========================================================
<!--#include file="adovbs.inc"-->
<%
strConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("/mattfest/db/banners.mdb" & ";"
Set Conn = Server.CreateObject("ADODB.Connection"
Conn.Open strConnectionString
sqltemp = "SELECT * FROM Banners"
SET rsTemp = Server.CreateObject("adodb.Recordset"
rsTemp.open sqltemp, Conn, adopenstatic
IF Request.Cookies("banners"("adnum" = "" THEN
CurrentBanner = "1"
ELSE
CurrentBanner = Request.Cookies("banners"("adnum"
END IF
sqlBanners = "SELECT * FROM Banners WHERE ID = " & CurrentBanner
rsBanners = Conn.Execute(sqlBanners)
Response.Write "<a href=""" & rsBanners("URL" & """ target=""_blank""><img src=""" & rsBanners("Image" & """ border=""0"" alt=""" & rsBanners("Name" & """></a>"
IF CurrentBanner = TotalBanners THEN
Response.Cookies("banners"("adnum" = "1"
ELSE
Response.Cookies("banners"("adnum" = CurrentBanner + 1
END IF
%>
============================================================
It will go through the banner rotation, but when it's done, it gives me this:
ADODB.Field error '80020009'
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
/mattfest/banners.asp, line 0
I don't know what's wrong... Can you guys help? Thanks in advance!