snowboardr
Programmer
Microsoft VBScript runtime error '800a000d'
Type mismatch
/vzio/banner/ad2.asp, line 91
www.vzio.com
/ ![[wink] [wink] [wink]](/data/assets/smilies/wink.gif)
Type mismatch
/vzio/banner/ad2.asp, line 91
Code:
<html>
<head>
<META NAME="ROBOTS" CONTENT="NOINDEX">
</head>
<BODY BGCOLOR="" topmargin="0" leftmargin="0" bottommargin="0">
<%
'# Declare variables
Dim ConnString, strSQL
Dim sMyID, sMyCat
'# site banner is on
Dim strOldID, strView, strBank, strSiteCat
'# Selected banner
Dim strBIMG, strBannerExp, strSiteBank, strSelectedID
'# Settings
Dim strBannerMinusShown, strSitePlusShown
'######################################
ConnString = "dsn=vzio"
set my_conn= Server.CreateObject("ADODB.Connection")
'######################################
my_conn.Open ConnString
sMyID = "100004"
'sMyCat = "100"
strSQL = "SELECT * FROM settings WHERE id=1"
set admin = my_conn.Execute(strSQL)
strBannerMinusShown = admin("bannerminus_Shown")
strSitePlusShown = admin("siteplus_Shown")
set admin = nothing
If Request.QueryString("BID") <> "" then sMyID = Request.QueryString("BID")
set info = Server.CreateObject("ADODB.RecordSet")
strSQL = "SELECT * FROM ebanner WHERE bID=" & sMyID
set info = my_conn.Execute(strSQL)
'# get last banner shown
strOldID = info("old_id")
strView = info("onsite_view")
'# so we can add +2 for showing a banner
strBank = info("bank")
'# get this sites category
strSiteCat = info("sCat")
set info = nothing
set selectabanner = Server.CreateObject("ADODB.RecordSet")
strSQL = "SELECT * FROM ebanner WHERE bank > 0 AND bCat=" & strSiteCat & " AND bID <> " & sMyID & " AND bID >= " & strOldID & " ORDER BY bID ASC LIMIT 1"
set selectabanner = my_conn.Execute(strSQL)
strSelectedID = selectabanner("bID")
'# banner image link
strBIMG = selectabanner("banner_img")
'# so we can add 1 to site exposure
strBannerExp = selectabanner("user_exposure")
'# so we can minus 2
strSiteBank = selectabanner("bank")
strOLDid = selectabanner("old_id")
set selectabaner = nothing
'# Max ID
set maxid = Server.CreateObject("ADODB.RecordSet")
strSQL = "SELECT bID FROM ebanner WHERE bank > 0 AND bCat=" & strSiteCat & " ORDER BY bID DESC LIMIT 1"
set maxid = my_conn.Execute(strSQL)
strMaxId = maxid("bID")
set maxid = nothing
'# Check max ID
If strSelectedID = strMaxID or strSelectedID = "" then '# ERROR HERE LINE 91
set selectabanner = Server.CreateObject("ADODB.RecordSet")
strSQL = "SELECT * FROM ebanner WHERE bank > 0 AND bCat=" & strSiteCat & " AND bID <> " & sMyID & " AND bID > 0 ORDER BY bID ASC LIMIT 1"
set selectabanner = my_conn.Execute(strSQL)
strSelectedID = selectabanner("bID")
'# banner image link
strBIMG = selectabanner("banner_img")
'# so we can add 1 to site exposure
strBannerExp = selectabanner("user_exposure")
'# so we can minus 2
strSiteBank = selectabanner("bank")
strOLDid = selectabanner("old_id")
set selectabanner = nothing
End if
'# update banner shown data
set updatebanner = Server.CreateObject("ADODB.RecordSet")
strSQL = "UPDATE ebanner SET bank=" & strSiteBank - strBannerMinusShown & ", onsite_exposures=" & strBannerExp + 1 & " WHERE bID=" & strSelecteID
Set updatebanner = my_conn.execute(strSql)
'# update site account information
set updatesite = Server.CreateObject("ADODB.RecordSet")
strSQL = "UPDATE ebanner SET bank=" & strSiteBank + strSitePlusShown & ", onsite_view=" & strView + 1
Set updatesite = my_conn.execute(strSql)
%>
<a href="#"><img src="<%=strBIMG%>" border="0"></a> <%=strSelectedID%>
</body>
</html>

![[wink] [wink] [wink]](/data/assets/smilies/wink.gif)