1

My Java application works well on two of my colleague's computers, however it will not run on mine.

The application reads a spreadsheet, creates tables in access from it and then compares them. The application is able to read and create the tables, but will not compare them.

The error I am getting is

 java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Undefined function 'replace' in expression.

I have read the other threads on this but wasn't able to gain much insight. Since we know the code works, is there something I can check on my machine that might be preventing this from working?

Any help would be greatly appreciated.

// Connection Code //

Connection dbConnection = null;
String ACCESSDB_Driver = "sun.jdbc.odbc.JdbcOdbcDriver";
String connURL="jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=" + databasePath.trim() + "\\" + accessFileName.trim() + ".accdb;";
Gord Thompson
  • 116,920
  • 32
  • 215
  • 418
Tourtelot
  • 137
  • 3
  • 15
  • which version of java are you running? – inbinder Jul 21 '17 at 16:22
  • What version of the access driver do you have installed? Your coworkers? – Jacob H Jul 21 '17 at 16:24
  • Are you using an ODBC DSN to establish the link to the database? If so, then check the DRIVER associated with that DSN to ensure that you are using the same driver as your colleagues (i.e., `(*.mdb, *.accdb)` vs. just `(*.mdb)`). – Gord Thompson Jul 21 '17 at 16:27
  • I believe I am using Java SE 1.7 @inbinder – Tourtelot Jul 21 '17 at 16:37
  • I checked in ODBC Data Source Administrator and I have both access drivers. 6.0.1 for (*.mdb) and 12.0 for (*.mbd, *.accdb) We are using *.mbd, *.accdb to connect. @GordThompson – Tourtelot Jul 21 '17 at 16:38
  • If I recall correctly, 12.x is the Access_2007 version. You could try downloading the [Access_2010 version](http://www.microsoft.com/en-US/download/details.aspx?id=13255) (14.x) and see if that works any better. – Gord Thompson Jul 21 '17 at 16:52
  • @GordThompson I am using Access 2007 for the application. Would it be bad to upgrade to that version given I am using 2007? – Tourtelot Jul 21 '17 at 16:57
  • Are your colleagues also using Access 2007 (and the 12.x version of the ODBC driver)? – Gord Thompson Jul 21 '17 at 17:07
  • @GordThompson Yes, I just confirmed they are on the same version. – Tourtelot Jul 21 '17 at 17:27

1 Answers1

1

The answer to this question was I was using Microsoft Access Driver (*.mdb, *.accdb) 12.x instead of 14.x

Tourtelot
  • 137
  • 3
  • 15