Hoi mensen, na 1.5 dag aan et klooien te zijn kan ik alleen concluderen dat er een bug in de jdbc-odbc bridge zit. Of er zit een bug in m`n hoofd!
Keb dit naar sun gestuurd:
A DESCRIPTION OF THE PROBLEM :
When executing a query which uses distinct or group by the resultset contains an incorrect value of numberOfRows.
I have the following 2 tables in an Microsoft Access
database, 97, 2000 or 2002 all the same problem:
Table 1
-------
Name:
- Activity
Fields:
- Activity-ID, Autoincrement, Primary Key
- ActivityName, String
Data: ( 1 record )
- Activity-ID: 1
- ActivityName: JSP Programming
Table 2
-------
Name:
- Course
Fields:
- Course-ID, Autoincrement, Primary Key
- CourseName, String
- Activity-ID, foreignkey, references Activity.Activity-ID
Data: ( 3 records )
- Course-ID: 2
- CourseName: Week 1
- Activity-ID: 1
- Course-ID: 3
- CourseName: Week 2
- Activity-ID: 1
- Course-ID: 4
- CourseName: Week 3
- Activity-ID: 1
When I query for the following:
SELECT DISTINCT Activity.ActivityName FROM Activity,
Course WHERE Activity.[Activity-ID] = Cursus.[Activity-ID]
The ResultSet indicates that there are 3 rows, while there
is only 1 result!! The first row is filled with the ActivityName but the second two rows contain null values. I saw with the debugger (in JBuilder) that the value of numberOfRows in java.sql.ResultSet is 3, which isn`t correct, it should be 1! This is what`s causing the problem.
The correct output should be a resultset which have only 1
row with the value: 'JSP Programming'
I have tested the query in access but access does return a correct row count.
Regards, CK
Iemand een oplossing oid ?
Keb dit naar sun gestuurd:
A DESCRIPTION OF THE PROBLEM :
When executing a query which uses distinct or group by the resultset contains an incorrect value of numberOfRows.
I have the following 2 tables in an Microsoft Access
database, 97, 2000 or 2002 all the same problem:
Table 1
-------
Name:
- Activity
Fields:
- Activity-ID, Autoincrement, Primary Key
- ActivityName, String
Data: ( 1 record )
- Activity-ID: 1
- ActivityName: JSP Programming
Table 2
-------
Name:
- Course
Fields:
- Course-ID, Autoincrement, Primary Key
- CourseName, String
- Activity-ID, foreignkey, references Activity.Activity-ID
Data: ( 3 records )
- Course-ID: 2
- CourseName: Week 1
- Activity-ID: 1
- Course-ID: 3
- CourseName: Week 2
- Activity-ID: 1
- Course-ID: 4
- CourseName: Week 3
- Activity-ID: 1
When I query for the following:
SELECT DISTINCT Activity.ActivityName FROM Activity,
Course WHERE Activity.[Activity-ID] = Cursus.[Activity-ID]
The ResultSet indicates that there are 3 rows, while there
is only 1 result!! The first row is filled with the ActivityName but the second two rows contain null values. I saw with the debugger (in JBuilder) that the value of numberOfRows in java.sql.ResultSet is 3, which isn`t correct, it should be 1! This is what`s causing the problem.
The correct output should be a resultset which have only 1
row with the value: 'JSP Programming'
I have tested the query in access but access does return a correct row count.
Regards, CK
Iemand een oplossing oid ?