Pludselig fejl i global.asa
Hvad nu må man spørge sig selv om...?Min kode er følgende:
<script language="vbscript" runat=server>
Sub Application_OnStart
'Tax percentage to add to order total
Dim stax
stax = 0.21
Application("taxP") = stax
End Sub
Sub Application_OnEnd
End Sub
Sub Session_OnStart
'Shopping cart array
Const cartAttributes = 5
Const maxCartItems = 10
ReDim arrcart(cartAttributes,maxCartItems)
Session("MyCart") = arrcart
Session("cartItem") = 0
MinConnection = "PROVIDER=MSDASQL;DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("statistik.mdb") & ";UID=admin;PWD=;"
set minConn = server.CreateObject ("adodb.connection")
minConn.Open MinConnection
DateTimeEntrance = Now()
if len(Request.Cookies("Sample")) > 0 then
CookieID = Request.Cookies("Sample")
else
conn.execute "insert into cookies (DateCreated) " _
& "values (#" & DateTimeEntrance & "#)"
Set RSCookieID = conn.Execute("select CookieID from Cookies where " _
& "DateCreated = #" & DateTimeEntrance & "#")
CookieID = RSCookieID("CookieID")
Response.Cookies("Sample") = RSCookieID("CookieID")
Response.Cookies("Sample").Expires = #12/31/2000 00:00:00#
end if
set BC = server.createobject("MSWC.BrowserType")
IPAddress = Request.ServerVariables ("remote_addr")
UserAgent = Request.ServerVariables ("HTTP_USER_AGENT")
Browser = BC.Browser & " " & BC.Version
DHTMLSupport = cstr(BC.dhtml)
FramesSupport = cstr(BC.frames)
TablesSupport = cstr(BC.tables)
CookiesSupport = cstr(BC.cookies)
BackgroundSounds = cstr(BC.backgrounds)
JavaScriptSupport = cstr(BC.javascript)
JavaAppletsSupport = cstr(BC.javaapplets)
ActiveXControlsSupport = cstr(BC.activexcontrols)
AOL = cstr(BC.aol)
Platform = cstr(BC.platform)
VBScriptSupport = cstr(BC.vbscript)
FullReferer = Request.ServerVariables("http_referer")
if len(FullReferer) <= 7 then
RefererDomain = "-"
RefererQuery = "-"
else
SlashPosition = instr(8, FullReferer, "/")
if SlashPosition = 0 then
RefererDomain = FullReferer
RefererQuery = "-"
else
RefererDomain = left(FullReferer, SlashPosition - 1)
RefererQuery = right(FullReferer, len(FullReferer) - slashPosition)
end if
end if
SQL = "insert into Visitors (DateTimeEntrance, IPAddress, UserAgent, Browser, "
SQL = SQL & "DHTML, Frames, Tables, Cookies, BackgroundSounds, Javascript, "
SQL = SQL & "JavaApplets, ActiveXControls, AOL, Platform, VBScript, "
SQL = SQL & "RefererDomain, RefererQuery, CookieID) values ("
SQL = SQL & "'" & DateTimeEntrance & "', "
SQL = SQL & "'" & IPAddress & "', "
SQL = SQL & "'" & UserAgent & "', "
SQL = SQL & "'" & Browser & "', "
SQL = SQL & "'" & DHTMLSupport & "', "
SQL = SQL & "'" & FramesSupport & "', "
SQL = SQL & "'" & TablesSupport & "', "
SQL = SQL & "'" & CookiesSupport & "', "
SQL = SQL & "'" & BackgroundSounds & "', "
SQL = SQL & "'" & JavaScriptSupport & "', "
SQL = SQL & "'" & JavaAppletsSupport & "', "
SQL = SQL & "'" & ActiveXControlsSupport & "', "
SQL = SQL & "'" & AOL & "', "
SQL = SQL & "'" & Platform & "', "
SQL = SQL & "'" & VBScriptSupport & "', "
SQL = SQL & "'" & RefererDomain & "', "
SQL = SQL & "'" & RefererQuery & "', "
SQL = SQL & "'" & CookieID & "')"
minConn.Execute SQL
Set RSRecordID = minConn.Execute("select RecordID from Visitors where DateTimeEntrance = #"_
& DateTimeEntrance & "#")
Session("RecordID") = clng(RSRecordID("RecordID"))
End Sub
Sub Session_OnEnd
Connection = "PROVIDER=MSDASQL;DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("statistik.mdb") & ";UID=admin;PWD=;"
set conn = server.CreateObject ("adodb.connection")
Conn.Open Connection
Connection.execute "update Visitors set DateTimeExit = #" & Now() _
& "# where RecordID = " & Session("RecordID")
End Sub
</script>
Fejlbesked er:
ADODB.Field error '800a0bcd'
Either BOF or EOF is True, or the current record has been deleted; the operation requested by the application requires a current record.
//global.asa, line 97
Linie 97: Session("RecordID") = clng(RSRecordID("RecordID"))
Hvad går nu galt???
