Results 1 to 5 of 5
  1. #1
    KyleS is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    3

    SQL issue creating a table

    I am trying to use SQL to create a table in my database with the Java DBMS I keep getting this error



    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in field definition.
    So I think it is not in my java code but the issue is actually in my SQL query, I have tried several variations but I still can't seem to get it to execute .

    Code:
    CREATE TABLE someTable(key VARCHAR PRIMARY KEY(20), someField VARCHAR(20), someOtherField VARCHAR(500), someReallyBigField MEMO)
    Thanks for your help I really appreciate the time!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,625
    Are you creating table in Access db or some other app db?

    Did you try:

    CREATE TABLE someTable(key VARCHAR(20) PRIMARY KEY, someField VARCHAR(20), someOtherField VARCHAR(500), someReallyBigField MEMO)

    or

    CREATE TABLE someTable(key VARCHAR(20) PRIMARY KEY, someField VARCHAR(20), someOtherField VARCHAR(500), someReallyBigField VARCHAR(max))
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    KyleS is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    3
    Yes and I got this stack trace no joy

    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in field definition.
    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 sun.jdbc.odbc.JdbcOdbcStatement.executeUpdate(Unkn own Source)
    at languageInterperater.databaseConnector.checkTable( databaseConnector.java:153)
    at languageInterperater.databaseConnector.connect(dat abaseConnector.java:54)
    at languageInterperater.langInterpMain.starting(langI nterpMain.java:66)
    at languageInterperater.langInterpMain.main(langInter pMain.java:18)

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,625
    Well, I don't know what java expects but running the first SQL in Access works.

    Maybe you need to post thread in a java forum.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    KyleS is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    3
    Tried that, they said it was the SQL :-p I will keep hunting around thanks for your time

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 03-09-2012, 01:07 PM
  2. Linked table issue
    By Ara in forum Access
    Replies: 4
    Last Post: 01-09-2012, 12:40 PM
  3. I am stuck already! Table Issue.
    By Kevo in forum Access
    Replies: 1
    Last Post: 06-19-2011, 07:17 PM
  4. Table link issue
    By rbienko in forum Access
    Replies: 2
    Last Post: 09-30-2010, 11:18 AM
  5. Table/Form Issue
    By ginap in forum Access
    Replies: 3
    Last Post: 06-17-2009, 01:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums