Well, then the output is the following:
SQL-Command:
'insert into Labels(label_name) values ("test");'
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too
few parameters. Expected 1.
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcStatement.execute(Unknown Source)
at
org.strumpflohner.CodeNotebook.Data.DBManager.SQLCommand(DBManager.java:46)
at
org.strumpflohner.CodeNotebook.Data.TestClass.main(TestClass.java:12)
I also copied this query into Access at executed it from there and it
works perfectly...
Sorry, but what do you mean with SSCE??
> > Hi,
> >
[quoted text clipped - 19 lines]
>
> If that shed no light on the problem, I'd construct and post a SSCE.
Thomas Hawtin - 30 Jul 2006 10:31 GMT
> 'insert into Labels(label_name) values ("test");'
In ANSI SQL, shouldn't that be:
insert into Labels(label_name) values ('test')
Double quotes should surround identifiers, not literal strings. OTOH,
IIRC, Access does something non-standard with [ and ].
Tom Hawtin
kito - 30 Jul 2006 16:28 GMT
Ohhh.... f***
Yes, for sure it should....When I wrote the query in the Access Editor
it allowed me to put quotes, but clearly I have to put the string
between ' '
Thanks a lot!!
> > 'insert into Labels(label_name) values ("test");'
>
[quoted text clipped - 6 lines]
>
> Tom Hawtin
kito - 30 Jul 2006 16:28 GMT
Ohhh.... f***
Yes, for sure it should....When I wrote the query in the Access Editor
it allowed me to put quotes, but clearly I have to put the string
between ' '
What a stupid mistake...
Thanks a lot!!
> > 'insert into Labels(label_name) values ("test");'
>
[quoted text clipped - 6 lines]
>
> Tom Hawtin
noname - 30 Jul 2006 11:25 GMT
> Well, then the output is the following:
> SQL-Command:
[quoted text clipped - 13 lines]
> works perfectly...
> Sorry, but what do you mean with SSCE??
I don't know about SSCE either, but the concern is the output of your
query, like numbers of insert.. etc.. sounds like it expected 1, and
there was none. So either look for the appropriate java function to use
or change your query.
In hope it's gonna help..
friendly from a poor harassed man with no job because he is under heavy
harassment.
Ian Wilson - 03 Aug 2006 18:51 GMT
> Sorry, but what do you mean with SSCE??
I meant SSCCE but made a typing error.
http://mindprod.com/jgloss/sscce.html