Hi
I have a strange problem with JDBC and Access.
Im trying to create a table and insert values into it,
but i'm getting an error saying it doesn't like the syntax, and is "expected
1".
for example:
s.execute("create table tblTest(id text, description memo)");
s.execute("insert into tblTest values(123,123)"); //works fine
s.execute("insert into tblTest values(AB123,123)"); //does not work
even tried:
s.execute("insert into tblTest values("AB123",123)"); // still does not work
please help on this strange problem.
Cheers
Sharp tool
Bjorn Abelli - 13 Jun 2005 14:09 GMT
"Sharp Tool" wrote...
> I have a strange problem with JDBC and Access.
The errors you're getting aren't strange at all...
> Im trying to create a table and insert values into it,
> but i'm getting an error saying it doesn't like the
[quoted text clipped - 11 lines]
>
> please help on this strange problem.
The SQL syntax states that literal values of character types needs to be
enclosed within "single" quotation marks, e.g.:
insert into tblTest values('AB123','123')
Some DB's can "convert" numerical values into their string equivalents,
which is why you *don't* get an error at this line.
insert into tblTest values(123,123)
...but in this line it runs into something that is neither a string literal
or a numerical value:
insert into tblTest values(AB123,123)
// Bjorn A