I'm adding an include to my simple default.asp page and I get the following error:
Microsoft VBScript compilation error '800a0400'
Expected statement
/ads/120.asp, line 1
Option Explicit
^
I'm NEW with ASP and I'm not sure what's missing or wrong!!
Here is the code for 120.asp:
<% Option Explicit %>
<!-- #include virtual="/dbwork/db.asp"-->
<%
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection"
objConn.ConnectionString = application("DSN"
objConn.Open
Dim objRS
Set objRS = Server.CreateObject("ADODB.Recordset"
objRS.Open "SELECT * FROM ads where width=120 and hunter=1 and activead=1", objConn, adOpenStatic, adLockReadOnly
if objRS.eof then%>
<img src=" width=131 height=73 border=0 alt="">
<% else
Dim rndMax
rndMax = CInt(objRS.RecordCount)
objRS.MoveFirst
Dim rndNumber ' RANDOMIZE RECORDS
Randomize Timer
rndNumber = Int(RND * rndMax)
objRS.Move rndNumber
Response.Write("<a href=' trim(objRS("AID"
)& "&url="& trim(objRS("adURL"
) &"'><img src='../images/ads/"& trim(objRS("imgsrc"
) &"' border='0' width='468' height='60' alt='"& trim(objRS("altText"
)&"'></a>"
Call OpenConn()
Dim updateAdView
updateAdView= "Update ads set webviews =" & objRS("webviews"
+ 1 &" where AID="& objRS("aid"
dbc.execute(updateAdView)
Call CloseConn()
end if
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>
Thanks,
Lisa
Microsoft VBScript compilation error '800a0400'
Expected statement
/ads/120.asp, line 1
Option Explicit
^
I'm NEW with ASP and I'm not sure what's missing or wrong!!
Here is the code for 120.asp:
<% Option Explicit %>
<!-- #include virtual="/dbwork/db.asp"-->
<%
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection"
objConn.ConnectionString = application("DSN"
objConn.Open
Dim objRS
Set objRS = Server.CreateObject("ADODB.Recordset"
objRS.Open "SELECT * FROM ads where width=120 and hunter=1 and activead=1", objConn, adOpenStatic, adLockReadOnly
if objRS.eof then%>
<img src=" width=131 height=73 border=0 alt="">
<% else
Dim rndMax
rndMax = CInt(objRS.RecordCount)
objRS.MoveFirst
Dim rndNumber ' RANDOMIZE RECORDS
Randomize Timer
rndNumber = Int(RND * rndMax)
objRS.Move rndNumber
Response.Write("<a href=' trim(objRS("AID"
Call OpenConn()
Dim updateAdView
updateAdView= "Update ads set webviews =" & objRS("webviews"
dbc.execute(updateAdView)
Call CloseConn()
end if
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>
Thanks,
Lisa