准备写个程序,现在用JDBC ODBC,想要程序初始化的时候建立一个列表,里面包含URL连接的那个数据库里面的所有表的名字,不知道怎么实现?如果用SQL server就很好解决,直接SELECT * FROM sysobjects WHERE type = 'U' 就可以,或者MSSQL的show table。可问题是现在只能用MS Access数据库!上面的两条SQL语句不能用。帮忙一下!谢谢了!
调试欢乐多
结果抛出来些东西,难道我权限有问题??还是DSN要设置一下?怎么弄?java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] 不能读取记录;在 'MsysObjects' 上没有读取数据权限。
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcStatement.execute(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcStatement.executeQuery(Unknown Source)
谢谢
还有,我建议你要用 odbc ,太古老了。
1. Open Microsoft Access
2. From the Tools menu, select the Options menu option
3. On the View tab, click the System Objects checkbox
4. Click OK to save your changes
5. From the Tools menu, select the Security -> User and Group Permissions menu option
6. Click the Permissions tab
7. Select the Table entry in the Object Type combo box
8. Select the Admin userid in the User/Group Name listbox
9. In the Object Name listbox, select the MSysObjects entry
20. In the Permissions group box, check the Read Data check box