Results 1 to 10 of 10
  1. #1
    Chrysler is offline Member
    Join Date
    Nov 2010
    Posts
    3
    Rep Power
    0

    Default Problem connecting Microsoft Access to Java GUI

    public Connection connect() {
    //Connection conn;
    String driver = "sun.jdbc.odbc.JdbcOdbcDriver";
    String url = "jdbc:easysoft://localhost/C:/Documents and Settings/Chrysler/Desktop/MovieDatabase.accdb";
    String username = "Chrysler";
    String password = "chrisujt782";

    try{
    Class.forName("easysoft.sql.jobDriver").newInstanc e();
    conn = DriverManager.getConnection(url, username, password);
    new JOptionPane().showMessageDialog(null, "IT WORKED");
    }catch(Exception e){System.out.println(e.getMessage());}
    finally{return conn;}
    }

    -- The catch block always prints "valid logonuser and optional logonpassword must be specified to gain access to this system". I've tested the user name and password on a separate program linked to the same database and everything works fine on that separate program. Any ideas anyone?? Thanks in advance.

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    Try leaving off the "//localhost/"

    Edit: Then again nevermind. I have no idea about this "easysoft" driver. I would say to ask the authors.

  3. #3
    Chrysler is offline Member
    Join Date
    Nov 2010
    Posts
    3
    Rep Power
    0

    Default

    i tried leaving it out, but it returns an error. thanks anyway.

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,002
    Rep Power
    20

    Default

    Does the documentation for this driver tell you what the format of the url should be?

    I'm wondering if the uname and pword should be stuck into the url...

  5. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,002
    Rep Power
    20

    Default

    Quoting from this easysoft page.

    Why can’t I connect to my Microsoft Access .mdb file using the Easysoft JDBC-ODBC Bridge?
    ...
    Add the following attributes to the JDBC connection URL:

    logonuser=username:logonpassword:password
    So uname and pword need to be part of the url.

  6. #6
    Chrysler is offline Member
    Join Date
    Nov 2010
    Posts
    3
    Rep Power
    0

    Default

    "jdbc:easysoft://127.0.0.1/C:/Documents and Settings/Chrysler/Desktop/MovieDatabase.accdb:logonuser=
    Chrysler:logonpassword=chrisujt782"

    jdbc:easysoft://127.0.0.1/C:/Documents and Settings/Chrysler/Desktop/MovieDatabase.accdb:logonuser=
    'Chrysler':logonpassword='chrisujt782' "

    "jdbc:easysoft://localhost/C:/Documents and Settings/Chrysler/Desktop/MovieDatabase.accdb:logonuser=
    Chrysler:logonpassword=chrisujt782"

    hey thanks for the tip. i've tried all of the above, but it doesnt seem to work. the catch block prints out a syntax error this time,
    Syntax Error in jdbc url at '/Documents and Settings/Chrysler/Desktop/MovieDatabase.accdb:logonuser=Chrysler:logonpasswo rd=chrisujt782'

    this is becoming a pain in the neck hahaha

  7. #7
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    Describe, in full, "doesn't seem to work".

    Also, that user and password, are those set in the Acess DB? If so those options are user and password. logonuser and logonpassword are, obviously, the user and password you use to log onto that system. Also, if you log onto that system using a domain, the the user is probably not "Chrysler", but rather "Domain\Chrysler".

    Edit: You did, also, see the note about "non-local admin" users in the documentation, right?

  8. #8
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,002
    Rep Power
    20

    Default

    Is there a difference between an accdb and an mdb?
    I know next to nothing about Access and its varieties.

    Which driver is it you're using?
    Do you have the documentation for it?
    Since easysoft have several drivers it's quite possible I picked the wrong one to look at...

    ETA: See? Can't rely on some chap on t'internet to do your googling and documentation reading for you...
    :)
    Last edited by Tolls; 11-30-2010 at 12:02 PM.

  9. #9
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    Quote Originally Posted by Tolls View Post
    Is there a difference between an accdb and an mdb?
    I know next to nothing about Access and its varieties.

    Which driver is it you're using?
    Do you have the documentation for it?
    Since easysoft have several drivers it's quite possible I picked the wrong one to look at...

    ETA: See? Can't rely on some chap on t'internet to do your googling and documentation reading for you...
    :)
    "accdb" is Access 2007 (and later)
    "mdb" is Access 97-2003

  10. #10
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,002
    Rep Power
    20

Similar Threads

  1. Replies: 3
    Last Post: 12-01-2011, 06:40 AM
  2. face problem to read data from microsoft access
    By chyeeqi in forum New To Java
    Replies: 7
    Last Post: 08-21-2009, 01:08 PM
  3. Replies: 0
    Last Post: 12-16-2008, 08:32 AM
  4. Replies: 1
    Last Post: 08-07-2007, 07:51 AM
  5. connect to microsoft access
    By bbq in forum JDBC
    Replies: 1
    Last Post: 07-09-2007, 03:33 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •