SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old October 18th, 2009, 07:23 PM
Smee Smee is offline
Registered User
Click here for more information
 
Join Date: Aug 2009
Location: Melbourne, Australia
Posts: 21 Smee User rank is Lance Corporal (50 - 100 Reputation Level)Smee User rank is Lance Corporal (50 - 100 Reputation Level)Smee User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 15 h 14 m 9 sec
Reputation Power: 0
Query - General - SQL error using ORDER BY

Not sure if anyone can assist with this, but here goes.

I am currently connecting to a DB2 Server from the Back End of an Access database using the following:

"SELECT BRANCHID, BRANCH from MDDT_BRANCHES IN 'MDDTS1.MDDDB;' [ODBC;DSN=MDDDB];"

This works fine as is, however I am trying to sort the results on the BRANCH field within this table with:

"SELECT BRANCHID, BRANCH from MDDT_BRANCHES ORDER BY BRANCH IN 'MDDTS1.MDDDB;' [ODBC;DSN=MDDDB];"

Doing this gives the following error:

"In operator without () in query expression 'BRANCH IN 'MDDTS1.MDDDB;' [ODBC;DSN=MDDDB]'."

Is anyone able to help me out with this as I get the same error if I attempt to use a WHERE function as well?

Any help is greatly appreciated.

Reply With Quote
  #2  
Old October 20th, 2009, 12:55 AM
June7 June7 is offline
Contributing User
Click here for more information.
 
Join Date: Apr 2009
Location: The Great Land
Posts: 536 June7 User rank is First Lieutenant (10000 - 20000 Reputation Level)June7 User rank is First Lieutenant (10000 - 20000 Reputation Level)June7 User rank is First Lieutenant (10000 - 20000 Reputation Level)June7 User rank is First Lieutenant (10000 - 20000 Reputation Level)June7 User rank is First Lieutenant (10000 - 20000 Reputation Level)June7 User rank is First Lieutenant (10000 - 20000 Reputation Level)June7 User rank is First Lieutenant (10000 - 20000 Reputation Level)June7 User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 13 h 58 m 7 sec
Reputation Power: 124
Any reason you cannot use the Access link tool and then query through the link?

I am not familiar with using [ODBC;...] parameter you are employing, regardless, doesn't the ORDER BY BRANCH have to be at the end of the SQL?

Reply With Quote
  #3  
Old October 20th, 2009, 08:06 PM
Smee Smee is offline
Registered User
Click here for more information
 
Join Date: Aug 2009
Location: Melbourne, Australia
Posts: 21 Smee User rank is Lance Corporal (50 - 100 Reputation Level)Smee User rank is Lance Corporal (50 - 100 Reputation Level)Smee User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 15 h 14 m 9 sec
Reputation Power: 0
Not sure what you refer to when you say "Access link tool"? But I am trying to avoid having any tables in this database, even linked ones, due to users who cant keep out....

Everything is being linked directly to the DB2 server, and I am trying to pass ALL Processing directly to the server as this database is currently being used in 300+ locations by 500+ concurrent users.

I know that Access is not ideal for this, and up until now, it has all sat within the Access Database itself. I have now been asked to migrate the data and processing to a secure DB2 server (for obvious reasons), but for now, we are still limited to using an Access Application.

I just cant seem to get some of what is usually a simple function to work when I include the ODBC settings in the SQL string?

Reply With Quote
  #4  
Old October 20th, 2009, 08:40 PM
June7 June7 is offline
Contributing User
Click here for more information.
 
Join Date: Apr 2009
Location: The Great Land
Posts: 536 June7 User rank is First Lieutenant (10000 - 20000 Reputation Level)June7 User rank is First Lieutenant (10000 - 20000 Reputation Level)June7 User rank is First Lieutenant (10000 - 20000 Reputation Level)June7 User rank is First Lieutenant (10000 - 20000 Reputation Level)June7 User rank is First Lieutenant (10000 - 20000 Reputation Level)June7 User rank is First Lieutenant (10000 - 20000 Reputation Level)June7 User rank is First Lieutenant (10000 - 20000 Reputation Level)June7 User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 13 h 58 m 7 sec
Reputation Power: 124
Quote:
I am currently connecting to a DB2 Server from the Back End of an Access database using the following:...
You are using code in an Access backend to connect to and query DB2 tables? Access has a tool to do the linking then you can query through the link. Are you using Access2007 - on the ExternalData tab select More/dBase. Users can't modify the structure of the linked table, just the data. However, if you still want to do it in code as recordset, did you try the ORDER BY at the end of the SQL string?

Could set up the backend so users can't see the navigation pane when opening (unless they hold the shift key - shhhh!)

Last edited by June7 : October 20th, 2009 at 08:45 PM.

Reply With Quote
  #5  
Old October 21st, 2009, 04:47 PM
Smee Smee is offline
Registered User
Click here for more information
 
Join Date: Aug 2009
Location: Melbourne, Australia
Posts: 21 Smee User rank is Lance Corporal (50 - 100 Reputation Level)Smee User rank is Lance Corporal (50 - 100 Reputation Level)Smee User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 15 h 14 m 9 sec
Reputation Power: 0
We are using Access 2002, and I have tried using ORDER BY at the end of the SQL. I also have the same issue with the WHERE function, and have not been able to get any sort of resolution.

I can hide the Nav Pane when opening, and can also Disable the Shift Key, but this then makes it difficult if I need to get in to make alterations. ( you would also have to hide the Toolbar so they cant use the "Show Database Window" button).

Reply With Quote
  #6  
Old October 21st, 2009, 06:09 PM
June7 June7 is offline
Contributing User
Click here for more information.
 
Join Date: Apr 2009
Location: The Great Land
Posts: 536 June7 User rank is First Lieutenant (10000 - 20000 Reputation Level)June7 User rank is First Lieutenant (10000 - 20000 Reputation Level)June7 User rank is First Lieutenant (10000 - 20000 Reputation Level)June7 User rank is First Lieutenant (10000 - 20000 Reputation Level)June7 User rank is First Lieutenant (10000 - 20000 Reputation Level)June7 User rank is First Lieutenant (10000 - 20000 Reputation Level)June7 User rank is First Lieutenant (10000 - 20000 Reputation Level)June7 User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 13 h 58 m 7 sec
Reputation Power: 124
When you setup project with restrictions like hiding the navigation pane and toolbars, can override these project-specific settings by pressing the shift key when executing opening file, at least this works in 2003 and 2007. Then you are free to edit at will.

Stumped on the SQL issue. Suggest you try the Access link utility just as a test, you can eliminate it later.

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > Query - General - SQL error using ORDER BY


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek