close ad
Help us test the new Databridge BETA with MySQLi support
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

DataAssist Sort

Thread began 11/30/2009 11:38 am by cstaton361847 | Last modified 12/01/2009 4:32 pm by Jason Byrnes | 1201 views | 8 replies |

cstaton361847

DataAssist Sort

The Sort feature works fine when the recordset is setup with no filters. As soon as I add a WHERE statement, I get the following error when clicking the link to sort:
Microsoft OLE DB Provider for SQL Server error '80040e14'
Incorrect syntax near the keyword 'ORDER'.
It points to line 117 - "Set rsDisplayData = rsDisplayData_cmd.Execute"
How can I implement a WHERE filter and still allow the sorting to function?

Sign in to reply to this post

Jason ByrnesWebAssist

is the name of the db column you are sorting with "order"? if so this is a reserved word in SQL and should not be used as a column name. see the following for a full list of reserved words in MS SQL:
aa238507%28SQL.80%29.aspx


if not, please post a copy of your page that is generating the error s we can investigate the code.

Sign in to reply to this post

cstaton361847

RE:

I've attached the source code. Thanks.

Attached Files
sort_tmp.asp.txt
Sign in to reply to this post

Jason ByrnesWebAssist

to trouble shoot this error, change line 97:

Set rsDisplayData = rsDisplayData_cmd.Execute




to:

On Error Resume Next
Response.Write(rsDisplayData_cmd.CommandText)
Set rsDisplayData = rsDisplayData_cmd.Execute





this will write the sql generating the error to the screen, please post back the SQL

Sign in to reply to this post

cstaton361847

RE:

SELECT * FROM dbo.tblGISDataRequest WHERE ((Status <> 'Completed') OR (Status IS NULL));

Sign in to reply to this post

Jason ByrnesWebAssist

have you triggered the sorting? I dont see how this SQL could generate the order you report?

Sign in to reply to this post

cstaton361847

RE:

I don't either :| I do not have any triggers in place, or views that I'm using. The SQL is exactly all that I'm using...straight lookup to a table that is limited to the WHERE statement (No ORDER BY). As soon as I remove the WHERE statement, the sorting works fine.

Sign in to reply to this post

cstaton361847

RE:

Remember the old saying...It's ALL about the DETAILS...I removed the semi-colon from the end of the SQL statement and it works now!
SELECT * FROM dbo.tblGISDataRequest WHERE ((Status <> 'Completed') OR (Status IS NULL));
to
SELECT * FROM dbo.tblGISDataRequest WHERE ((Status <> 'Completed') OR (Status IS NULL))

Sign in to reply to this post

Jason ByrnesWebAssist

OK, glad to hear it is working.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...