【发布时间】:2015-10-12 06:55:03
【问题描述】:
我有一个 accdb 文件。我正在使用 ucanaccess api 从我的 Java 项目连接到它并处理数据。 (我没有 MS Access,我在我的 Java 项目中使用 ucanaccess 作为引用库)。
但是,我遇到了一个奇怪的问题,当我在 SQL 服务器中导入 accdb 文件并运行查询 SELECT B.grd , b.[credit hours] , b.term from [1i-stem dcccd student courses] B where [student id] = '2169095'; 时,我得到以下输出:
但是当我在 ucanaccess 中运行查询时,我得到以下输出:
(在 ucanaccess 命令行输出中有两条额外的记录,grd 为空)。
当我输入 .accdb 文件路径时,我在 ucanaccess 控制台中收到以下消息:
Please, enter the full path to the access file (.mdb or accdb): C:\\Users\\Tejas\\Desktop\\sample.accdb
log4j:WARN No appenders could be found for logger (com.healthmarketscience.jackcess.impl.DatabaseImpl).
log4j:WARN Please initialize the log4j system properly.
WARNING:External file P:\IE\Warehouse (New 1-27-15)\MVC Data Warehouse.mdb does not exist
WARNING:given file does not exist: P:\IE\Warehouse (New 1-27-15)\MVC Data Warehouse.mdb
WARNING:External file P:\IE\Warehouse (New 1-27-15)\MVC Data Warehouse.mdb does not exist
WARNING:given file does not exist: P:\IE\Warehouse (New 1-27-15)\MVC Data Warehouse.mdb
WARNING:External file P:\IE\Warehouse (New 1-27-15)\MVC Data Warehouse.mdb does not exist
WARNING:given file does not exist: P:\IE\Warehouse (New 1-27-15)\MVC Data Warehouse.mdb
WARNING:External file P:\IE\Warehouse (New 1-27-15)\GPA - Standing.mdb does not exist
WARNING:given file does not exist: P:\IE\Warehouse (New 1-27-15)\GPA - Standing.mdb
WARNING:External file P:\IE\Warehouse (New 1-27-15)\MVC Data Warehouse.mdb does not exist
WARNING:given file does not exist: P:\IE\Warehouse (New 1-27-15)\MVC Data Warehouse.mdb
WARNING:External file P:\IE\Warehouse (New 1-27-15)\MVC Data Warehouse.mdb does not exist
WARNING:given file does not exist: P:\IE\Warehouse (New 1-27-15)\MVC Data Warehouse.mdb
WARNING:External file P:\IE\Warehouse (New 1-27-15)\MVC Data Warehouse.mdb does not exist
WARNING:given file does not exist: P:\IE\Warehouse (New 1-27-15)\MVC Data Warehouse.mdb
WARNING:External file P:\IE\Warehouse (New 1-27-15)\MVC Data Warehouse.mdb does not exist
WARNING:given file does not exist: P:\IE\Warehouse (New 1-27-15)\MVC Data Warehouse.mdb
WARNING:External file P:\IE\Warehouse (New 1-27-15)\MVC Data Warehouse.mdb does not exist
WARNING:given file does not exist: P:\IE\Warehouse (New 1-27-15)\MVC Data Warehouse.mdb
WARNING:Error in the metadata of the table 12i-Fac Info: table's row count in the metadata is 1642 but 1652 records have been found and loaded by UCanAccess. All will work fine, but it's better to repair your database.
WARNING:Error in the metadata of the table 3i-STEM STUDENTS LOAD BY TERM: table's row count in the metadata is 8716 but 4358 records have been found and loaded by UCanAccess. All will work fine, but it's better to repair your database.
Error occured at the first loading attempt of 12i-Faculty Latetst Information
Converted view was :CREATE VIEW "Z_12I-FACULTY LATETST INFORMATION" AS SELECT "STUDENT COURSE"."FAC ID", Last("STUDENT COURSE"."FACULTY LAST NAME") AS "LASTOFFACULTY LAST NAME", Last("STUDENT COURSE"."FACULTY FIRST NAME") AS "LASTOFFACULTY FIRST NAME"
FROM "STUDENT COURSE"
GROUP BY "STUDENT COURSE"."FAC ID"
Error message was :user lacks privilege or object not found: STUDENT COURSE
Loaded Tables:
10i-STEM STUDENT LATEST MAJOR INFORMATION, 12i-Fac Info, 13-F1 students by Term, 14i- Faculty Per Term, 15i- STEM COURSE MASTER, 15i- STEM COURSE MASTER by TERM, 1i-STEM DCCCD STUDENT COURSES, 2i - STEM latest Student Information, 3i-STEM STUDENTS LOAD BY TERM, 4i-STEM STUDENT Latest GPA, 5i-STEM MVC STUDENT COURSE 2014-15AY, 6-Financial AID By Sum of Term Amt, 7-STEM - ACAD YR MASTER, 7-STEM MVC Acad-YR TERM, 8i-STEM STUDENT COURSE STATUS BY TERM, 9-STEM TERM MASTER, Financial AID By Sum of Term Amt, STEM TERM VALUES
Loaded Queries:
2014-15AY STEM STUDENT UNIQ ID AS OF 6-4-15, 2i-STEM UNIQUE STUDENT LATEST TERM
Loaded Indexes:
Primary Key on 1i-STEM DCCCD STUDENT COURSES Columns: (ID)
, Primary Key on 5i-STEM MVC STUDENT COURSE 2014-15AY Columns: (ID)
, Primary Key on STEM TERM VALUES Columns: (Term Code)
, Index on 12i-Fac Info Columns: (FAC ID)
, Index on 7-STEM - ACAD YR MASTER Columns: (CODE)
, Index on STEM TERM VALUES Columns: (Term Code)
Cannot load view MVC Acad_YR - TERM : user lacks privilege or object not found: STUDENT COURSE
Cannot load view 12i-Faculty Latetst Information : user lacks privilege or object not found: STUDENT COURSE
Cannot load view 4i-STEM STUDENTS Latest GPA - 3 : user lacks privilege or object not found: GPA - TERM AND CUMM
Cannot load view Update the Term Master : user lacks privilege or object not found: STUDENT COURSE
Cannot resolve table 5- STEM MVC Course
Cannot resolve table Course
Cannot resolve table First Time in College
Cannot resolve table GPA - Term and Cumm
Cannot resolve table Student
Cannot resolve table Student Course
Cannot resolve table Student Financial Aid
Cannot resolve table Student Load
Cannot resolve table Student Type
UCanAccess>
Copyright (c) 2012 Marco Amadei
UCanAccess version 3.0.1
You are connected!!
Type quit to exit
Commands end with ;
use:
export <pathToCsv>;
for exporting into a .csv file the result set from the last executed query
UCanAccess>SELECT B.grd , b.[credit hours] , b.term from [1i-stem dcccd student courses] B where [student id] = '2169095';
------------------------------
| GRD | Credit Hours | Term |
------------------------------
| W | 4.0 | 2009FA |
| F | 3.0 | 2009FA |
| A | 3.0 | 2009FA |
| F | 3.0 | 2009FA |
| F | 3.0 | 2010SP |
| F | 3.0 | 2010SP |
| F | 3.0 | 2010SP |
| C | 4.0 | 2010SP |
| F | 3.0 | 2010SP |
| D | 3.0 | 2012S2 |
| C | 3.0 | 2012S2 |
| A | 4.0 | 2014FA |
| A | 4.0 | 2015SP |
| A | 4.0 | 2015SP |
| null | 4.0 | 2015FA |
| null | 4.0 | 2015FA |
UCanAccess>
还有其他类似的不一致。就像在 SQL Server 中一样,对于特定查询,其中一个列输出是“A”,但在 ucanaccess 中它是“null”。
我该如何解决这个问题?
【问题讨论】:
-
您知道,这些信息无法回答。 ms访问的结果是什么?什么是“1i-stem dcccd 学生课程”,是查询还是表格?如果它是我所期望的查询,它的定义是什么?您使用的是哪个 ucanaccess 版本? – jamadei 3 分钟前
-
我没有 MS Access。我在我的 java 项目中使用 ucanaccess 作为连接到
.accdb文件的引用库。第二个图像是 ucanaccess 命令提示符中的 o/p。1i-stem dcccd student courses是一张桌子。 ucanaccess 的版本是3.0.1。 -
您可以发送整个 ucanaccess 控制台的输出吗?如果可能,并且只有在没有私人或个人数据的情况下,最好通过 ucanaccess 论坛或任何其他方式获得数据库副本。 GRD 是计算字段吗?如果你直接用jackcess打开db怎么办?(如果你不知道怎么写,我可以发布需要的两行代码)
-
我已经编辑了问题以添加整个控制台输出。这个 accdb 文件是我们的客户上传到我们的 Java 应用程序的文件,我们只是通过运行查询和处理结果来读取它。所以我不知道
GRD是否是一个计算字段——但我最好的猜测是它是。是的,请告诉我 Jackcess 代码。 -
另外,很抱歉我无法将文件上传到 sourceforge,它包含敏感数据。
标签: java ucanaccess