Results 1 to 10 of 10
- 11-30-2010, 09:19 AM #1
Member
- Join Date
- Nov 2010
- Posts
- 3
- Rep Power
- 0
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.
- 11-30-2010, 09:36 AM #2
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
Try leaving off the "//localhost/"
Edit: Then again nevermind. I have no idea about this "easysoft" driver. I would say to ask the authors.
- 11-30-2010, 09:45 AM #3
Member
- Join Date
- Nov 2010
- Posts
- 3
- Rep Power
- 0
i tried leaving it out, but it returns an error. thanks anyway.
- 11-30-2010, 10:16 AM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
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...
- 11-30-2010, 10:19 AM #5
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Quoting from this easysoft page.
So uname and pword need to be part of the url.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
- 11-30-2010, 11:45 AM #6
Member
- Join Date
- Nov 2010
- Posts
- 3
- Rep Power
- 0
"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
- 11-30-2010, 11:57 AM #7
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
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?
- 11-30-2010, 12:00 PM #8
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
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.
- 11-30-2010, 12:10 PM #9
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
- 11-30-2010, 01:25 PM #10
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Similar Threads
-
Accessing a remote Microsoft Access database
By ajeeb in forum JDBCReplies: 3Last Post: 12-01-2011, 06:40 AM -
face problem to read data from microsoft access
By chyeeqi in forum New To JavaReplies: 7Last Post: 08-21-2009, 01:08 PM -
Connecting JTable With Microsoft SQL Server 2005 or Oracle
By WNIGAGLIONI in forum JDBCReplies: 0Last Post: 12-16-2008, 08:32 AM -
Help with access a database using Microsoft Access
By cachi in forum JDBCReplies: 1Last Post: 08-07-2007, 07:51 AM -
connect to microsoft access
By bbq in forum JDBCReplies: 1Last Post: 07-09-2007, 03:33 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks