SQLTeam.com | Weblogs | Forums

Microsoft OLE DB Provider for SQL Server error '80040e14'


#1

I have a SQL Server error that appears on our website on the following page and similar pages...

http://nbotickets.com/event.asp?performer=5053&n=Mikey+Sweet

Microsoft OLE DB Provider for SQL Server error '80040e14'
Incorrect syntax near the keyword 'DEFAULT'.
/partials/event_detail.asp, line 332

Not an expert, could use some assistance letting me know where to start. Thanks, Jim


#2

Open up the code for that page and go to line 332. What is there? Post it for us to help.


#3

Line 332 oRcs.Open cmd


#4

We need to see the SQL command that it is executing.


#5

Where would I find that particular SQL command?


#6

Does this help??

    strSQLShows = "SELECT TOP 10 Shows.Show_city, Shows.Show_id, Shows.Show_description, Shows.Show_type, Shows.Show_special_title, "_
        & "Shows.Show_venue, Shows.Show_venue_info, Shows.Show_date, Shows.Show_time, Show_Tix_EventCode, Shows.Show_special_message, "_
        & "Shows.Show_Cancelled_Message, Shows.Show_Tix_AllowPurch,  Shows.Show_Tix_OnSaleDate, Performers.Performer_name, Performers.Performer_links, "_
        & "Performers.Performer_id,Performers.Performer_image_thumbnail, Performers.Performer_image_full, "_
        & "Performers.Performer_description, Performers_Join_Shows.order_id, Performers_Join_Shows.headliner "_
        & "FROM (Shows  WITH (nolock) INNER JOIN Performers_Join_Shows on Shows.Show_id = Performers_Join_Shows.fkShow_id) "_
        & "INNER JOIN Performers ON Performers.Performer_id = Performers_Join_Shows.fkPerformer_id "_
        & "WHERE Shows.Show_id <> ? AND Performers.Performer_id = ? AND Shows.Show_date > GETDATE() AND (Shows.Show_Approved = 1) AND ((Shows.Show_Cancelled = 0) OR (Shows.Show_Cancelled IS NULL)) " _
        & "ORDER BY Shows.Show_date DESC, Performers_Join_Shows.Order_id DESC "    
        
        Set cmd = Server.CreateObject("ADODB.Command")    
        cmd.ActiveConnection = oConn
        cmd.CommandText = strSQLShows
        cmd.CommandType = 1
        cmd.Parameters(0) = show_id        
        cmd.Parameters(1) = performer_id
        
        
        set oRcs = Server.CreateObject("ADODB.Recordset")
        oRcs.CursorLocation=3
        oRcs.LockType=1 
        oRcs.Open cmd

        if oRcs.EOF then
        else
            if strTempShowID <> oRcs("Show_id") then
                Response.Write "<b>Other Appearances:</b><br>"
                Do until oRcs.EOF
                    strShowVenue = oRcs("Show_venue")
                    strShowType = oRcs("Show_type")
                    strShowDate = oRcs("Show_date")
                    strShowTime = Replace(Replace(Replace(oRcs("Show_time"),":00",""),"AM","am"),"PM","pm")
                    tempShow_Tix_EventCode = oRcs("Show_Tix_EventCode")
                       
                    if Mid(oRcs("Show_time"),1,1) = 0 then
                        strShowTime = Mid(strShowTime,2)
                    end if

                    Response.write  WeekdayName(WeekDay(strShowDate)) & ", " & MonthName(Month(strShowDate)) & " " & Day(strShowDate) & " at "
                    Response.Write strShowTime 
                    
                    if oRcs("Show_Tix_EventCode") > 1 AND NOW() > oRcs("Show_Tix_OnSaleDate") AND UCASE(oRcs("Show_Tix_AllowPurch")) = "Y" then 
                        xFree = NULL
                        xFree = EV_Free(tempShow_Tix_EventCode,0)
                        if IsNumeric(xFree) = true then  
                            if xFree > 0 then
                            %>
                                <a href="../load_event_1.asp?event=<%=tempShow_Tix_EventCode%>"> <img src="images/buytix50_white.gif" border="0" width="40" align="absmiddle"></a>
                            <%
                            else
                            %>
                                <label class="alert alert-error">
                                    Advanced ticket sales are sold out, however, a limited number of tickets may be available on a first come first serve basis at the door.
                                </label>
                            <%
                            end if
                        else 
                            %>
                                <label class="alert alert-error">
                                    <%= xFree %>
                                </label>
                            <%    
                        end if
                    else 
                        if oRcs("Show_Tix_OnSaleDate") <> "" AND oRcs("Show_Tix_OnSaleDate") <> CDate("1/1/2004") then
                            %>
                            <label class="alert alert-error">
                                On Sale <%= oRcs("Show_Tix_OnSaleDate") %>
                            </label>
                        <% else %>
                            <label class="alert alert-error">
                                On Sale date TBA.
                            </label>
                            <%
                        end if 
                    end if 
                
                    extra_shows = 1
                    intTempShowID = oRcs("Show_id")
                    do until intTempShowID <> oRcs("Show_id")
                        oRcs.MoveNext
                        if oRcs.EOF then
                            exit do
                        end if
                    loop
                loop
            end if 
        end if
        %>
    </div>
</div>    
<%
oRs.MoveNext
oRs.close
oConn.close
%>
<!--#include virtual="/partials/related_links.asp"-->
<%

End Sub


#7

Are you using Dreamweaver? It seems to be a common error if using Dreamweaver.

Here is one page that has some good links on it: http://forums.asp.net/t/551797.aspx?Incorrect+syntax+near+the+keyword+DEFAULT+


#8

I am using Dreamweaver to make edits but a programmer did this page years ago but most likely not in Dreamweaver. He was a staunch opponent to DMX!


#9

Check out the links (the last reply) in the page I linked to. It appears to be a Dreamweaver issue and not something we (SQL people) can help with.


#10

I will look at the links. So the error code shows up as text on the bottom of the web page and the rest of the page is O.K. is that normal?


#11

Actually the links are all bad now. I thought they were going to show some of the pages I came across.

Where is show_id and performer_id being set? It might be related to this issue: http://evadman.blogspot.com/2011/08/bug-in-adodbcommand-parameters.html


#12

We have an admin we use that automatically generates event ID numbers for each of the shows.


#13

But are the variables being set in the code? I would recommend stepping through the code in debug mode and seeing exactly where the problem is.


#14

I believe the variables are all built within the asp page. I've just tried to figure out the debug aspect of Dreamweaver and it claims there are none built-in. I then went to the Google Chrome Developers page to try it as well but I think I am now in over my head!