Trying to create a database in a MS Access DB via JDBC drivers

From: Albretch (lbrtchx_at_hotmail.com)
Date: 07/24/04


Date: 24 Jul 2004 09:30:22 -0700


. I am trying to create a database in a MS Access DB via JDBC drivers.
I have tried both sun.jdbc.odbc.JdbcOdbcDriver and ids.sql.IDSDriver

 From some reason both drivers Exceptions tell me 'Syntax error in
CREATE TABLE statement' even though I am not creating a table, but a
Database

// - - - - - - - - - - - - sun.jdbc.odbc.JdbcOdbc
 aSQL=CREATE DATABASE dbtest;
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]
Syntax error in CREATE TABLE statement.
        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(Unknown
Source)
        at JDBCDL00.createCtlg(JDL00.java:200)
        at JDL00.main(JDL00.java:505)

// - - - - - - - - - - - - ids.sql
 aSQL=CREATE DATABASE dbtest;
java.sql.SQLException: [42000][Microsoft][ODBC Microsoft Access
Driver] Syntax error in CREATE TABLE statement
        at ids.sql.IDSSocket.error(IDSSocket.java:374)
        at ids.sql.IDSSocket.verify(IDSSocket.java:320)
        at ids.sql.IDSStatement.submit(IDSStatement.java:157)
        at ids.sql.IDSStatement.execute(IDSStatement.java:479)
        at ids.sql.IDSStatement.executeUpdate(IDSStatement.java:270)
        at JDBCDL00.createCtlg(JDL00.java:200)
        at JDL00.main(JDL00.java:505)

 Does it mean MS Access does not have a concept of a BD, since it is
kind of a file base Data Store?

 There is also something I don't quite know how to interpret.

 When you ask the JdbcOdbc driver for Catalogs it gives you

. . .\Office\Samples\ADDRBOOK
. . .\Office\Samples\CONTACT
. . .\Office\Samples\INVENTRY
. . .\Office\Samples\Northwind

 even if you declare the a USer DSN only to

. . .\Office\Samples\Northwind

 Experimentally I dropped a copy of

. . .\Office\Samples\Northwind.mdb

 in

. . .\IDS\File\examples

 and set up a system DSN to got IDSExamples.mdb

 However, while query the DBMS for catalogs, I got

. . .\IDS\File\examples\IDSExamples
. . .\IDS\File\examples\Northwind

 Does it mean Access considers the folder containing the '.mdb' file
as sort of a 'schema'?

 How could u still create a Database using JDBC in a MSAccess DB?



Relevant Pages

  • Re: Cannot display ODBC login prompt - want to connect without DSN
    ... database without knowing anything beforehand except the driver name. ... need a connection string and different data sources use different connection ... ODBC, ADO, and VB Script. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: JDBC URL for Oracle Database With Failover (2 db servers)
    ... After you've loaded the driver, you can establish a connection using ... each form requires a database URL. ... For Oracle, the database URL has ...
    (comp.lang.java.databases)
  • RE: New JDBC 1.2 driver runs slower than JDBC 1.1; my db definitio
    ... If the support incident ends up verifying a slowdown in the new driver, ... New JDBC 1.2 driver runs slower than JDBC 1.1; ... I do think this would happen in general, not just for my database; ...
    (microsoft.public.sqlserver.jdbcdriver)
  • RE: Import external data - web query
    ... Your reply for my query is very extensive, this is for importing a file from ... The data source I want isn't listed in the Select Data Source dialog box. ... information used to connect to a database. ... Check your driver First, make sure you have the right ODBC driver (Open ...
    (microsoft.public.excel.misc)
  • Trying to create a database in a MS Access DB via JDBC drivers
    ... I am trying to create a database in a MS Access DB via JDBC drivers. ... Syntax error in CREATE TABLE statement. ... Driver] Syntax error in CREATE TABLE statement ...
    (comp.lang.java.databases)