我在Access mdb文件中有一个vba函数。我试图从jdbc运行查询。虽然查询在访问中运行良好,但是从jdbc我得到一个错误说:
[Microsoft][ODBC Microsoft Access Driver] Undefined function 'fun' in expression
以下是我的代码片段:
Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=xyz.mdb;";
Connection conn = DriverManager.getConnection(database,"","");
Statement select = conn.createStatement();
ResultSet result = select
.executeQuery("SELECT * FROM table where fun()=1");