You are on page 1of 2

Several issues seem to be like the last one...

BUT I can't figure out how to


address/fix.

All of the ones below get error '80040e14' ...incorrect syntax near the word 'list
the word below'

ISSUE #1
rs.Open "SELECT * FROM FullDump WHERE EventID = " & intEventID & " AND LocationID =
" & Session("LocationID"), cn, 3, 3
the syntax error is near the word 'AND'
FullDump is a 'view' in the sql database

is it possible that the Location ID is missing (or has been


dropped)?

FULL CODE SNIPPET


Set rs = Server.CreateObject ("ADODB.Recordset")
bolGoodSec = True

If bolGoodSec = False Then


Response.Redirect "Dignity_loginfail.asp?redir=default.asp&status=" &
bolGoodStatus
Else
If Request.QueryString("EventID") <> "" Then
intEventID = Request.QueryString("EventID")
ElseIf Request.Form("EventID") <> "" Then
intEventID = Request.Form("EventID")
Else
intEventID = Session("EventID")
End If

If If Not IsNull(Session("LocationID")) And Len(Session("LocationID"))


> 0 AND Not IsNull(intEventID) And Len(intEventID) > 0 Then

rs.Open "SELECT * FROM FullDump WHERE EventID = " & intEventID &
" AND LocationID = " & Session("LocationID"), cn, 3, 3

End If

ISSUE #2
rs.Open "SELECT Events.EventID, Events.d_First, Events.d_Last, Events.e_Last,
Events.eventdate FROM dbo.Events INNER JOIN dbo.FSPs ON dbo.Events.FSPID =
dbo.FSPs.FSPID WHERE (Events.eventdate >= { fn NOW() } - 61) AND (Events.Status IS
NULL) AND FSPs.LocationID = " & Session("LocationID") & " ORDER BY Events.EventID
DESC", cn, 3, 3
Syntax error is near the word 'ORDER'

Full code snippet


Set rs = Server.CreateObject ("ADODB.Recordset")

If If Not IsNull(Session("LocationID")) And Len(Session("LocationID"))


> 0 Then

rs.Open "SELECT Events.EventID, Events.d_First, Events.d_Last,


Events.e_Last, Events.eventdate FROM dbo.Events INNER JOIN dbo.FSPs ON
dbo.Events.FSPID = dbo.FSPs.FSPID WHERE (Events.eventdate >= { fn NOW() } - 61) AND
(Events.Status IS NULL) AND FSPs.LocationID = " & Session("LocationID") & " ORDER
BY Events.EventID DESC", cn, 3, 3

End If

Do While not rs.EOF

You might also like