MX Dynamic Table Sorter Forum :: desc and error in your SQL syntax

This thread was displayed: 1,604 times


Starting with 17th May 2007, Adobe Systems will stop offering support for any version of the discontinued InterAKT products. As a result, we will not answer to new support incidents starting with May 17th, 2007. Pending support incidents will still be followed in order to be closed. The product forums will remain open and be transformed in user-to-user forums. The general forums will be made read-only and not allow new posts or comments.

For more information about the affected products visit: www.interaktonline.com/Support/

View Threaded Show descending
Kenny DarcyTeam InterAKT member
11-20-2006 22:19:17 GMT +2

Hello,

I need to set a default column desc, I have my code below where I have added the desc it works , but sometimes I get this following error. is it correct how i placed the desc.

would be grateful for any advice.

regards

kenny

--------------------------------------------------

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[MySQL][ODBC 3.51 Driver][mysqld-4.1.19-standard]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DESC' at line 1

-------------------------------------------------

 

 

<%
Dim Reclistall__KTColParam1
Reclistall__KTColParam1 = "0"
If (Request.QueryString("see") <> "") Then
  Reclistall__KTColParam1 = Request.QueryString("see")
End If
%>
<%
Dim Reclistall__orderParam
Reclistall__orderParam = "cs_user_fusrs"
If (orderColumn_Reclistall <> "") Then
  Reclistall__orderParam = orderColumn_Reclistall
End If
%>
<%
Dim Reclistall
Dim Reclistall_cmd
Dim Reclistall_numRows
Dim Reclistall_cmd_query

Set Reclistall_cmd = Server.CreateObject ("ADODB.Command")
Reclistall_cmd.ActiveC /> Reclistall_cmd_query = "SELECT cs_nav_list.nav_list_pk, cs_nav_list.nav_subject_name, cs_skilladd_usr.id_usr, cs_skilladd_usr.skill_id, cs_skilladd_usr.skill_ability, cs_skilladd_usr.skill_teach, cs_user_usr.date_usr, cs_user_usr.cs_user_fusrs, cs_profile_one.firstnames_usr, cs_profile_one.lastname_usrs, cs_profile_one.country_short_usrs, cs_skilladd_usr.skill_joint_id, cs_availability.search_available_usr FROM ((((cs_user_usr LEFT JOIN cs_skilladd_usr ON cs_skilladd_usr.id_usr=cs_user_usr.id_usr) LEFT JOIN cs_nav_list ON cs_nav_list.nav_list_pk=cs_skilladd_usr.skill_id) LEFT JOIN cs_profile_one ON cs_profile_one.id_usr=cs_user_usr.id_usr) LEFT JOIN cs_availability ON cs_availability.id_usr=cs_user_usr.id_usr) WHERE cs_nav_list.nav_list_pk=?  AND cs_availability.search_available_usr =1 ORDER BY " + Reclistall__orderParam +" DESC"
Reclistall_cmd.CommandText = Reclistall_cmd_query
Reclistall_cmd.Prepared = true
Reclistall_cmd.Parameters.Append Reclistall_cmd.CreateParameter("param1", 5, 1, -1, Reclistall__KTColParam1)

Set Reclistall = Reclistall_cmd.Execute
Reclistall_numRows = 0
%>
<%
Dim RepeatReclistall__numRows
Dim RepeatReclistall__index

RepeatReclistall__numRows = 0 + Session("max_rows_nav_Reclistall") + Session("max_rows_nav_Reclistall") + Session("max_rows_nav_Reclistall")
RepeatReclistall__index = 0
Reclistall_numRows = Reclistall_numRows + RepeatReclistall__numRows
%>
<%
nav_Reclistall.checkBoundries()
%>

Back | Reply | Quote | Top
Razvan Racasanu[InterAKT]Adobe Systems Romania staff
11-21-2006 14:21:05 GMT +2

Hello,

This can happen if the parameter Reclistall__orderParam already contains ASC or DESC since then you will either have ASC DESC or DESC DESC which is incorrect.

Can you attach the entire page so we can have a look at it?

Regards,
Razvan RACASANU

Reply | Quote | Top
Kenny DarcyTeam InterAKT member
11-21-2006 14:49:38 GMT +2

Thanks for your help.

regards

Kenny

Reply | Quote | Top
Razvan Racasanu[InterAKT]Adobe Systems Romania staff
11-21-2006 16:46:09 GMT +2

Hello,

I have moved the default DESC from the query to the default value assignment. Please try with this file.

Regards,
Razvan RACASANU

Reply | Quote | Top
Kenny DarcyTeam InterAKT member
11-21-2006 16:54:26 GMT +2

Razan Thank you it works


I had tried 

<%
Dim Reclistall__orderParam
Reclistall__orderParam = "cs_user_usr.lastlogin_usr" DESC
If (orderColumn_Reclistall <> "") Then
  Reclistall__orderParam = orderColumn_Reclistall
End If
%>

but that didnt work 

your code of

<%
Dim Reclistall__orderParam
Reclistall__orderParam = "cs_user_usr.lastlogin_usr DESC"
If (orderColumn_Reclistall <> "") Then
  Reclistall__orderParam = orderColumn_Reclistall
End If
%>


works great I was sure the desc should have been outside the "", now I know better. thanks again.

Kenny



Reply | Quote | Top
Kenny DarcyTeam InterAKT member
11-21-2006 22:25:58 GMT +2

Hi again,
I am using the "Records per page" with the apply button, but now it wont work since I changed what you told me to, the fact that I have given of desc should that change the RepeatReclistall__numRows = 0 + Session("max_rows_nav_Reclistall") .

regards

Kenny

Reply | Quote | Top
Razvan Racasanu[InterAKT]Adobe Systems Romania staff
11-22-2006 12:24:29 GMT +2

Hello,

Can you post in a private message FTP connection details and the URL of your page so we can try and see why this is happening?

Regards,
Razvan RACASANU

Reply | Quote | Top
MX Dynamic Table Sorter 1.8.0
© Adobe Systems Romania. All rights reserved.