Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 205
  • Last Modified:

Java and SQL

I am inserting, selecting and trying to update information from java to a MS Access database. However when updating this integer value into a field in the database, i receive an error saying "Too few Parameters, Expected 1"

from this statement : statement.executeUpdate("UPDATE ChildResults SET ChildIDNumber = " + getid + " WHERE ChildID = " + getid + "");

Thank you
0
Codster
Asked:
Codster
  • 9
1 Solution
 
girionisCommented:
 From http://support.microsoft.com/default.aspx?scid=kb;EN-US;q216425

"
Too few parameters. Expected 1.

CAUSE
This error occurs only with Microsoft Access when one of the column names specified in a select statement does not exist in the table being queried."

  Hope it helps.
0
 
CodsterAuthor Commented:
Yes the ChildID field is in a different tabel but a one to one relationship exists between the tables??????
0
 
girionisCommented:
 I do not know how well Access maps tables to each other. I have hardly used it. What you could do is to explicitly call the ChildID from the other table by providing the other table's name. For instance:

tatement.executeUpdate("UPDATE ChildResults SET ChildIDNumber = " + getid + "
WHERE <other table name>.ChildID = " + getid + "");

  Hope it helps.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
girionisCommented:
 And by the way, I do not think that a one to one relationship means that you can access a column of  a table if it is one to one related to another.
0
 
girionisCommented:
 And by the way, I do not think that a one to one relationship means that you can access a column of  a table if it is one to one related to another.
0
 
girionisCommented:
 And by the way, I do not think that a one to one relationship means that you can access a column of  a table if it is one to one related to another.
0
 
girionisCommented:
 And by the way, I do not think that a one to one relationship means that you can access a column of  a table if it is one to one related to another.
0
 
girionisCommented:
 And by the way, I do not think that a one to one relationship means that you can access a column of  a table if it is one to one related to another.
0
 
girionisCommented:
 And by the way, I do not think that a one to one relationship means that you can access a column of  a table if it is one to one related to another.
0
 
girionisCommented:
 And by the way, I do not think that a one to one relationship means that you can access a column of  a table if it is one to one related to another.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 9
Tackle projects and never again get stuck behind a technical roadblock.
Join Now