I have created a java swing code that is connected to the MS access 2000, I would like to know how to use the "Insert into" I can use the "SELECT" What i did: INSERT INTO table_name (field_name) VALUES (the value) and i always get this error message; java.sql.SQL.EXCEPTION:[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1
In my table there is only one field which is called "Name" Thank you
ltanuwij
Greenhorn
Joined: May 29, 2001
Posts: 2
posted
0
Don't worry i solved it
Frank Carver
Sheriff
Joined: Jan 07, 1999
Posts: 6913
posted
0
"Itanuwij", The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in again with a new name which meets the requirements. Thanks.
Yes u can insert into the MS ACCESSS 2000 pass the string into the statement.executeQuery("insert into <table Name>(<field1,field2) values('String','String',Integer)> look the followwing thing is a new thing which i found out if u hav some value assinged to a variable like String name = "amit"; and if u want to insert that variable then the syntax in the VALUES will be values('"+name+'",'"+name2+"')otherwise u will get an SQLExceptionjava.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1. ok then this might solve your query bye.