Meaningless Drivel is fun!*
The moose likes JDBC and the fly likes Getting sql error [Microsoft ][odbc microsoft access driver]numeric index out of range Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Getting sql error [Microsoft ][odbc microsoft access driver]numeric index out of range" Watch "Getting sql error [Microsoft ][odbc microsoft access driver]numeric index out of range" New topic
Author

Getting sql error [Microsoft ][odbc microsoft access driver]numeric index out of range

navinsingh dalal
Greenhorn

Joined: Feb 10, 2011
Posts: 6
I am using MS ACCESS as a data base to insert some text into the table and getting this error.If i do not add alphanumeric character in the text field than its working , but when i am writing alphanumeric character in this address field than i am getting this error.
navinsingh dalal
Greenhorn

Joined: Feb 10, 2011
Posts: 6
Please someone help me regarding this.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29220
    
135

Navin,
Note that this is an international forum. Due to work hours/sleep schedules, it can take up to 24 hours for people to see your post.

What does the DDL for customerdetails look like? In particular, how many columns and what types. Also, I recommend adding explicit column names to your query. That way you know Access is inserting the values in the order you intended.



[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Tom Reilly
Rancher

Joined: Jun 01, 2010
Posts: 618
Which line of code produces the error?
navinsingh dalal
Greenhorn

Joined: Feb 10, 2011
Posts: 6
I have a table of customer details which have four column.name(text),address(memo(alphanumeric)),phone number(number),rank(text).When i am entering text in the address field ,its working fine,but when i am using text and numeric its giving this error.I don't know resolve it .I have google it but got found nothing about how to resolve this error.please help.
navinsingh dalal
Greenhorn

Joined: Feb 10, 2011
Posts: 6
Jenne,

IF you don't write the column name it will select all the column.

Tom,

Its a run time error and it says sql error [Microsoft ][odbc microsoft access driver]numeric index out of range.And it comes when i am adding alphanumeric character to address field and it works fine when i am just entering text in address field.
navinsingh dalal
Greenhorn

Joined: Feb 10, 2011
Posts: 6
Thanks guys for your efforts .The problem is solved now .Its a mistake done by me as i have selected wrong data type in database.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29220
    
135

navinsingh dalal wrote:Jenne,

IF you don't write the column name it will select all the column.

Yes. In the order defined in the DDL. This means if that order cvhanges, the code won't work. Not something that happens often, but listing the columns is a good habit to get into. It also helps with readability.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting sql error [Microsoft ][odbc microsoft access driver]numeric index out of range
 
Similar Threads
The INSERT INTO statement contains the following unknown field name: 'OPANo'.
connecting java app to JAVADB...database
connecting java application to JAVADB...database
getText() is not working?
MY swing database application can not connect