• 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:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Need help Connecting to Excel (driver problem)

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all
I am having problems connecting to Excel files through ODBC
my code compiles perfectly but when I run it gives me the following error:
java.sql.SQLException: [Microsoft][ODBC Excel Driver] Could not find installable ISAM.
please helpme out.
It happened to me once when I was using VB to connect to an excel file
I re-installed visual studio in which I check the ISAM tabs in the DATA access dir
if any body can help me out on this
Thanks
Farooq
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try something like:
Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
c = DriverManager.getConnection( "jdbc:odbc:excel_dsn", "", "" );
stmnt = c.createStatement();
String query = "select * from [main$] where [Field1]='Test';";
ResultSet rs = stmnt.executeQuery( query );
With a DSN of "excel_dsn" pointing to your Excel workbook file.
 
reply
    Bookmark Topic Watch Topic
  • New Topic