473,406 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

ODBC call failed in ms access 2007.

99
Run-time error ‘3146’:
ODBC—call failed.
[Microsoft][ODBC SQL SERVER Driver][SQL Server]The ORDER BY position number 0 is out of range of the number of items in the select list.(#108)

The text above is the error that I am getting when I try to sort a column in my form.I am not able to understand what this error is supposed to mean.

Here is the code that I am using to sort the column,in case required.
Expand|Select|Wrap|Line Numbers
  1. Private Function ReOrder(vField As String)
  2.    Screen.MousePointer = MouseBusy
  3.    Me.OrderByOn = True
  4.    If Right(Me.OrderBy, 3) = "ESC" Then 'alleen laatste drie letters resolven
  5.       Me.OrderBy = vField & " ASC"
  6.    Else
  7.       Me.OrderBy = vField & " DESC"
  8.    End If
  9.    Me.Refresh 'requery
  10.    Screen.MousePointer = MouseNormal
  11. End Function
If I need to sort a column which has "No" as its control source and the header of the column is named lblPMNO
the I use this code,
Expand|Select|Wrap|Line Numbers
  1. Private Sub lblPMNO_Click()
  2. Reorder "No"
  3. End Sub
In case the recordsource of the form is expected:
Expand|Select|Wrap|Line Numbers
  1. SELECT DISTINCTROW tblMIMAIN.A_EQUIPDESCR AS
  2.  Equipment, tblMIMAIN.A_EQUIPNO AS [No], tblMIMAIN.A_ID,
  3.  tblMIMAIN.A_LOCATION AS Location, IIf(IsNull(tblMIMAIN!
  4. A_PROJECTID)," ","**13Mplan**") AS 13Months
  5. FROM tblMIMAIN
  6. WHERE (((tblMIMAIN.A_LOCATION)>IIf(GetAsset()
  7. ="**ALL**","a","ZZ") Or (tblMIMAIN.A_LOCATION)=GetAsset())
  8.  AND ((tblMIMAIN.A_SYSTEM)="STW"));
  9.  
Apr 17 '12 #1

✓ answered by Rabbit

No is a reserved key word. Change your column name.

1 2454
Rabbit
12,516 Expert Mod 8TB
No is a reserved key word. Change your column name.
Apr 17 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: tina | last post by:
Hello, Can you hale me to define my mistake please? I am trying to run a SQL Pass – Through Query from Access 2000 and inside the record set I am trying to loop for a LoginID. I think that this...
3
by: Yannick Turgeon | last post by:
Hello all, I'm using: - A97 (front-end) - MySQL drivers 3.51 - MySQL 4.0.18 (back-end) I've got a MySQL table connected to an Access DB throw an ODBC link. When I connect to this table, no...
1
by: VBSponge | last post by:
Hi all. Need help here as I cant see whats wrong... I have a querydef in Access 2k which execs a stored proc in a SQL Server 2k db. I keep getting the following error, and cant stop it for the...
4
by: pu | last post by:
Hi, Could any one tell me what the following messages means please? And where can I get the error messages with their descriptions? ===begin=== ODBC --call failed. blank (#110) ===end=== I...
9
by: mcbill20 | last post by:
Hello all. I just installed Oracle 10g developer tools on a machine running XP Pro and Office XP. Before this I had just the Oracle 9 client installed. I the previous configuration, I was able to...
8
by: Jimbo | last post by:
I have a form in access 97 that is populated by a query against some sql server tables....when ever the query pulls up only one record im fine..however if it pulls up more than one record i have...
1
by: Harmony407 | last post by:
Hello: Our organization uses MS Access to store all of our members information. Our primary database computer is running on Windows 98. This is where the main database exists. The MS Access...
12
by: mukeshhtrivedi | last post by:
We have 4 MS Access Databases with few tables on each DB. There are some reports which uses ODBC. When I try to use the report and input date range and click ok I get error "ODBC --call failed" it...
4
by: alegria4ever | last post by:
I have an Access 2000 database that links several tables from Oracle 9. For some reason or another, one of our user repeatedly gets the following error when accessing queries within this database:...
11
by: Kirby1 | last post by:
ODBC call failed -------------------------------------------------------------------------------- We have recently upgraded our SQL Server from 7.0 to 2000. Since then my Access database to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.