开发者

Inserting into Access database

开发者 https://www.devze.com 2023-01-31 17:07 出处:网络
How do I resolve the error in inserting memo in Access from a Java program? 4159 the size of the string

How do I resolve the error in inserting memo in Access from a Java program?

4159 the size of the string

the error

java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]COUNT field incorrect

The source code that executes the insert statement:

statement.executeUpdate("INSERT INTO webData VALUES ("+"'" + list.get(y)+"','"+data+ "')");

4159 the size of data

my schma is :

table name webData with 2 coulmun the

first ID of type text

the second Field1 of type memo

i have update the statment but i have get the same error:

statement.executeUpdate("INSERT INTO webData 开发者_开发技巧(ID,Field1) VALUES ("+"'" + list.get(y)+"','"+data+ "')");

Thank you


Please post your schema.

Rather than doing:

INSERT INTO webData VALUES (...)

You should be doing:

INSERT INTO webData (MyColumn1, MyColumn2) VALUES (...)

Do not rely on the physical column order in the table, you should state it explicitly to avoid errors.


Does the comma have to be in speech marks and inverted commas? You can simplify this, just a tip :). But yes, post your DB scheme.

0

精彩评论

暂无评论...
验证码 换一张
取 消