Getting 404 error when more than 9 columns
Getting 404 error when more than 9 columns
I am new to this and I am using server side processing with ajax to an asp page. When I define more than 8 columns for my table I get an ajax 404 error but it works fine with 9 or less columns. I have posted my code below. You will notice some of it commented out in the table and asp array so that they match up. If I uncomment one more th and one more array then I get the 404 ajax error.
Here is the javascript
$(document).ready(function() { var table = $('#tbl_call_log').DataTable({ "serverSide": true, "ajax": "get_call_data.asp", "searching": false, "deferRender": false }); } );Here is the asp page code:
<%
Dim objWSHNetwork
Dim SQLserver, SQLconnect, query, recordset
Dim sEcho, iDisplayLength, iDisplayStart, sSearch, iTotal, sql, conn, rs, rs1, a, GetRecords_cmd, Records, arrRecords
Dim iTotalDisplayRecords, strWhere, strOrderBy, order
Set a = jsArray()
set recordset = Server.CreateObject("ADODB.Recordset")
recordset.CursorType = 3 ' adOpenStatic
Set objWSHNetwork = Server.CreateObject("WScript.Network")
SQLServer = objWSHNetwork.ComputerName
Set SQLconnect = Server.CreateObject("ADODB.Connection") ' Prepare to connect to database
SQLconnect.Open "Driver={SQL Server};Server=" & SQLServer & "\sqlexpress;Database=call logging;UID=VCL;PWD=VCL"
'here we get some parameters passed by the DataTables using GET
sEcho = Cint(Request("sEcho"))
iDisplayLength = Cint(Request("length"))
iDisplayStart = Cint(Request("start"))
'sSearch = Request("sSearch")
'SEARCH - here we make the Where clause that will be used in the SQL query. You only put here the fields you want to search
' strWhere = " AND (engine LIKE '%" & sSearch & "%' OR "
' strWhere = strWhere & " browser LIKE '%" & sSearch & "%' OR "
' strWhere = strWhere & " platform LIKE '%" & sSearch & "%' OR "
' strWhere = strWhere & " version LIKE '%" & sSearch & "%' OR "
' strWhere = strWhere & " grade LIKE '%" & sSearch & "%')"
'ORDERING
'passes through all cols and first check if the column is sortable, if yes then construct
'the variable "order" that list in order the sequence of ordering
' for k=0 to 4
' if Request("bSortable_" & k)="true" then
' order = order & Request("iSortCol_" & k) & " " & Request("sSortDir_" & k)
' end if
' next
'here we replace the number corresponding the column position by the corresponding name of the column in the database
' order = Replace(order,"0",", engine")
' order = Replace(order,"1",", browser")
' order = Replace(order,"2",", platform")
' order = Replace(order,"3",", version")
' order = Replace(order,"4",", grade")
'here we eliminate the first comma of the variable "order"
' order = Right(order, Len(order)-1)
'here we create the variable "strOrderBy" that will be used in the SQL query
' strOrderBy = "ORDER BY " & order
'*********** iTotalRecords & iTotalDisplayRecords ***************
Set rs = SQLconnect.Execute("SELECT count() FROM Calls")
Set rs1 = SQLconnect.Execute("SELECT count() FROM Calls")
'************ ADODB Recordset **************
Set GetRecords_cmd = Server.CreateObject ("ADODB.Command")
GetRecords_cmd.ActiveConnection = SQLconnect
GetRecords_cmd.CommandText = Session("SSS_query_Calls_3145") & Session("SSS_whereclause2")
GetRecords_cmd.Prepared = true
Set Records = GetRecords_cmd.Execute
'************ Pagination **************
Records.Move(iDisplayStart)
'Records.Move(0)
'************ Display Length **************
arrRecords = Records.GetRows(iDisplayLength)
'arrRecords = Records.GetRows(10)
'************ ASP ARRAY to jsArray **************
For i = 0 to ubound(arrRecords,2)
Set a(Null) = jsArray()
a(Null)(Null) = arrRecords(0,i)
a(Null)(Null) = arrRecords(1,i)
a(Null)(Null) = arrRecords(2,i)
a(Null)(Null) = arrRecords(3,i)
a(Null)(Null) = arrRecords(4,i)
a(Null)(Null) = arrRecords(5,i)
a(Null)(Null) = arrRecords(6,i)
a(Null)(Null) = arrRecords(7,i)
a(Null)(Null) = arrRecords(8,i)
'a(Null)(Null) = arrRecords(9,i)
'a(Null)(Null) = arrRecords(10,i)
'a(Null)(Null) = arrRecords(11,i)
'a(Null)(Null) = arrRecords(12,i)
'a(Null)(Null) = arrRecords(13,i)
'a(Null)(Null) = arrRecords(14,i)
'a(Null)(Null) = arrRecords(15,i)
'a(Null)(Null) = arrRecords(16,i)
next
'************ ASPJSON ARRAY **************
response.write("{""sEcho"":"& sEcho &",""iTotalRecords"":"& rs(0) &",""iTotalDisplayRecords"":"& rs1(0) &",""aaData"":")
a.Flush
response.write("}")
SQLconnect.close
Set SQLconnect = nothing
%>
and here is html table
Call # | Tag | <%=Session("SSS_User_Field1_Name")%> | Station/Agent Number | Station/Agent Name |
---|
Replies
Never mind. I figured it out. My request string was too long. I changed the ajax type to POST and now it works fine.