Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Access JDBC LONGVARCHAR

1 view
Skip to first unread message

Ian deSouza

unread,
Jul 1, 2003, 6:16:20 PM7/1/03
to
I'm getting the following error:

create table Categories (CategoryID INTEGER, CategoryName VARCHAR,
Description LONGVARCHAR, Picture LONGVARBINARY)

java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]
Syntax error in field definition.
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6879)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7036)
at sun.jdbc.odbc.JdbcOdbc.SQLPrepare(JdbcOdbc.java:4784)
at sun.jdbc.odbc.JdbcOdbcConnection.prepareStatement(JdbcOdbcConnection.java:475)
at sun.jdbc.odbc.JdbcOdbcConnection.prepareStatement(JdbcOdbcConnection.java:443)

Any ideas? I imagine that Access does like LONGVARBINARY, even though
the driver tells me that this column is that SQL type when viewing the
database.metadata getColumns()..

Thanks in advance, Ian

Andy Flowers

unread,
Jul 2, 2003, 3:06:59 AM7/2/03
to
Your SQL syntax is wrong for MS Access. The LONGVARCHAR is not recognised by
Access, and neither is LONGVARBINARY.

Remember all that, basically, JDBC does with SQL statements is pass them
straight through to the database engine where it is validated and
interpreted.

I'd suggest that you MEMO instead of LONGVARCHAR and IMAGE instead of
LONGVARBINARY.

Test the query out in Access to ensure that it works OK before porting it to
the Java/JDBC-ODBC environment.

"Ian deSouza" <ian_d...@yahoo.com> wrote in message
news:e9681cc9.03070...@posting.google.com...

0 new messages