• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Driver does not support this function..

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First, I've already searched the forum for an answer and didn't find
anything that really seemed to answer it.
I'm using MS Access on Win 2000. I'm trying to access data that's already
in the table and when I run it, I get:
before resultset...
Exception occured...Driver does not support this function
java.sql.SQLException: Driver does not support this function
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String CbDb_url = "jdbc dbc river={Microsoft Access Driver" +
" (*.mdb)};DBQ=" +
"C:\\Project\\ODBC\\PartsBook\\PartsBook.mdb";
Connection con = DriverManager.getConnection(CbDb_url);
String sql = "SELECT * FROM PartsBook.PartsCategory";
PreparedStatement pstmt = con.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery( sql );

It fails on the executeQuery().
Based on other questions in this forum, I tried a
Statement statement con.createStatement() then
statement.executeQuery(sql), but that doesn't work either...
Can anyone tell me what I'm doing wrong?
Thanks...
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you tried running the query directly against Access? I'm guessing you just need "SELECT * FROM PartsCategory", but that's a pretty uneducated guess. I try not to use Access anymore.
 
Duane Riech
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That was the first thing I tried.
I have another little java program that populates the table with a
INSERT statement and it works fine. I guess my question is "Does MS Access"
support SQL statements?
Also, how do you query against the MS Access db using SQL. I was not aware
that you could. I have used a query via the Wizard, but not SQL.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I have another little java program that populates the table with a
INSERT statement and it works fine. I guess my question is "Does MS Access"
support SQL statements?

Yes it does. The INSERT statement was SQL, wasn't it?

Also, how do you query against the MS Access db using SQL. I was not aware that you could. I have used a query via the Wizard, but not SQL.


The code you posted looks fine from a Java point of view. What I don't know is whether the "jdbc:odbc:..." string you have is correct. I'll let someone who has actually done something with Access comment on that.
 
reply
    Bookmark Topic Watch Topic
  • New Topic