G
Georg Schulte Althoff
Dear NG,
I have a strange problem when reading values from my combobox control.
Sometimes the correct value is returned, but in some cases I get a wrong
result which is not corresponding to the selected data.
My form contains a combobox control (named cboGz) to select a
workcenter-group from a table. Column 1 is the bound column
The rowsource contains a simple SQL-statment:
SELECT GzId, Bez, StId FROM Gz ORDER BY GzId, StId;
The table is a linked table in an Oracle database.
When the user finishes seletion, I have to read the current values for GzId
and StId from the combobox:
vGzId = cboGz.Value ' bound column GzId
vStId = cboGz.Column(2)
sGzId is always filled with the correct value. But depending on the selected
row of data sStId is sometimes filled with data from another row or even
remains empty. The listindex property is then set to an unexpected value or
contains -1.
In my tests to find out what went wrong I checked three configurations
for my combobox control.
I know that the result of ORDER BY is different whether it is done by Access
or Oracle. So I created a local table in my Access database and a link to
the original table in Oracle. The primary key is (GzId, StId).
Table Gz_Access
Definition
GzId Text(30)
StId Text(30)
Bez Text(50)
Data (queried with no order)
GzId;StId;Bez
"1";"Aachen";""
"1";"Werk Dausenau";""
"APV-Gesamt";"Aachen";""
"APV-Gesamt";"Köln"
"APV-Gesamt";"Werk Dausenau";"Artikel-Prüf-Vorrichtung-Gesamt"
Table Gz_Oracle
Definition
GzId Varchar2(30)
StId Varchar2(30)
Bez Varchar2(50)
Data (queried with no order)
GzId;StId;Bez
"APV-Gesamt";"Werk Dausenau";"Artikel-Prüf-Vorrichtung-Gesamt"
"APV-Gesamt";"Aachen";""
"APV-Gesamt";"Köln"
"1";"Werk Dausenau";""
"1";"Aachen";""
I also created a pass-through-query to perform sorting in Oracle:
Definition:
SELECT * FROM Gz ORDER BY GzId, StId;
Data (queried with no order in access)
"APV-Gesamt";"Aachen";""
"APV-Gesamt";"Köln"
"APV-Gesamt";"Werk Dausenau";"Artikel-Prüf-Vorrichtung-Gesamt"
"1";"Aachen";""
"1";"Werk Dausenau";""
In a new form I created a combobox for each datasource:
cboGz_A_T
rowsource
"SELECT GzId, Bez, StId FROM Gz_Access ORDER BY GzId, StId;"
data in combobox
"1";"Aachen";""
"1";"Werk Dausenau";""
"APV-Gesamt";"Aachen";""
"APV-Gesamt";"Köln"
"APV-Gesamt";"Werk Dausenau";"Artikel-Prüf-Vorrichtung-Gesamt"
cboGz_O_T
rowsource
"SELECT GzId, Bez, StId FROM Gz_Oracle ORDER BY GzId, StId;"
data in combobox
"APV-Gesamt";"Aachen";""
"APV-Gesamt";"Köln"
"APV-Gesamt";"Werk Dausenau";"Artikel-Prüf-Vorrichtung-Gesamt"
"1";"Aachen";""
"1";"Werk Dausenau";""
cboGz_O_Q
rowsource
"SELECT GzId, Bez, StId FROM Gz_Query;"
data in combobox
"APV-Gesamt";"Aachen";""
"APV-Gesamt";"Köln"
"APV-Gesamt";"Werk Dausenau";"Artikel-Prüf-Vorrichtung-Gesamt"
"1";"Aachen";""
"1";"Werk Dausenau";""
Here are the results when selecting a row and reading some properties
(the values column(0) / column(2) / listindex are read from the control
from left to right)
cboGz_A_T
1/Aachen 0 / 1 / Aachen < correct
1/Werk Dausenau 0 / 1 / Aachen
APV-Gesamt/Aachen 2 / APV-Gesamt / Aachen < correct
APV-Gesamt/Köln 2 / APV-Gesamt / Aachen
APV-Gesamt/Werk Dausenau 2 / APV-Gesamt / Aachen
cboGz_O_T
1/Aachen -1 / /
1/Werk Dausenau -1 / /
APV-Gesamt/Aachen 0 / APV-Gesamt / Aachen < correct
APV-Gesamt/Köln 0 / APV-Gesamt / Aachen
APV-Gesamt/Werk Dausenau 0 / APV-Gesamt / Aachen
cboGz_O_Q
1/Aachen 3 / 1 / Aachen < correct
1/Werk Dausenau 3 / 1 / Aachen
APV-Gesamt/Aachen 0 / APV-Gesamt / Aachen < correct
APV-Gesamt/Köln 0 / APV-Gesamt / Aachen
APV-Gesamt/Werk Dausenau 0 / APV-Gesamt / Aachen
I suppose those many wrong results depend on the internal implementation
of the combobox control and its interaction with the data source.
I need to know why
1. the listindex is set to -1 if the datasource is a linked table.
2. only the first value of StId could be selected.
Any hints about the behaviour of the combobox control is welcome.
Is there an other control which is able to solve this selection?
At least some information about my environment:
OS: WinNT 4 SP6a or WinXP (German)
Access 2002 (10.4302.4219) SP-2 (German)
ODBC: Oracle 9.02.00.06
Oracle server: 9.2.0.1.0 (language AMERICAN, territory AMERICA)
Thanks
Georg Schulte Althoff
I have a strange problem when reading values from my combobox control.
Sometimes the correct value is returned, but in some cases I get a wrong
result which is not corresponding to the selected data.
My form contains a combobox control (named cboGz) to select a
workcenter-group from a table. Column 1 is the bound column
The rowsource contains a simple SQL-statment:
SELECT GzId, Bez, StId FROM Gz ORDER BY GzId, StId;
The table is a linked table in an Oracle database.
When the user finishes seletion, I have to read the current values for GzId
and StId from the combobox:
vGzId = cboGz.Value ' bound column GzId
vStId = cboGz.Column(2)
sGzId is always filled with the correct value. But depending on the selected
row of data sStId is sometimes filled with data from another row or even
remains empty. The listindex property is then set to an unexpected value or
contains -1.
In my tests to find out what went wrong I checked three configurations
for my combobox control.
I know that the result of ORDER BY is different whether it is done by Access
or Oracle. So I created a local table in my Access database and a link to
the original table in Oracle. The primary key is (GzId, StId).
Table Gz_Access
Definition
GzId Text(30)
StId Text(30)
Bez Text(50)
Data (queried with no order)
GzId;StId;Bez
"1";"Aachen";""
"1";"Werk Dausenau";""
"APV-Gesamt";"Aachen";""
"APV-Gesamt";"Köln"
"APV-Gesamt";"Werk Dausenau";"Artikel-Prüf-Vorrichtung-Gesamt"
Table Gz_Oracle
Definition
GzId Varchar2(30)
StId Varchar2(30)
Bez Varchar2(50)
Data (queried with no order)
GzId;StId;Bez
"APV-Gesamt";"Werk Dausenau";"Artikel-Prüf-Vorrichtung-Gesamt"
"APV-Gesamt";"Aachen";""
"APV-Gesamt";"Köln"
"1";"Werk Dausenau";""
"1";"Aachen";""
I also created a pass-through-query to perform sorting in Oracle:
Definition:
SELECT * FROM Gz ORDER BY GzId, StId;
Data (queried with no order in access)
"APV-Gesamt";"Aachen";""
"APV-Gesamt";"Köln"
"APV-Gesamt";"Werk Dausenau";"Artikel-Prüf-Vorrichtung-Gesamt"
"1";"Aachen";""
"1";"Werk Dausenau";""
In a new form I created a combobox for each datasource:
cboGz_A_T
rowsource
"SELECT GzId, Bez, StId FROM Gz_Access ORDER BY GzId, StId;"
data in combobox
"1";"Aachen";""
"1";"Werk Dausenau";""
"APV-Gesamt";"Aachen";""
"APV-Gesamt";"Köln"
"APV-Gesamt";"Werk Dausenau";"Artikel-Prüf-Vorrichtung-Gesamt"
cboGz_O_T
rowsource
"SELECT GzId, Bez, StId FROM Gz_Oracle ORDER BY GzId, StId;"
data in combobox
"APV-Gesamt";"Aachen";""
"APV-Gesamt";"Köln"
"APV-Gesamt";"Werk Dausenau";"Artikel-Prüf-Vorrichtung-Gesamt"
"1";"Aachen";""
"1";"Werk Dausenau";""
cboGz_O_Q
rowsource
"SELECT GzId, Bez, StId FROM Gz_Query;"
data in combobox
"APV-Gesamt";"Aachen";""
"APV-Gesamt";"Köln"
"APV-Gesamt";"Werk Dausenau";"Artikel-Prüf-Vorrichtung-Gesamt"
"1";"Aachen";""
"1";"Werk Dausenau";""
Here are the results when selecting a row and reading some properties
(the values column(0) / column(2) / listindex are read from the control
from left to right)
cboGz_A_T
1/Aachen 0 / 1 / Aachen < correct
1/Werk Dausenau 0 / 1 / Aachen
APV-Gesamt/Aachen 2 / APV-Gesamt / Aachen < correct
APV-Gesamt/Köln 2 / APV-Gesamt / Aachen
APV-Gesamt/Werk Dausenau 2 / APV-Gesamt / Aachen
cboGz_O_T
1/Aachen -1 / /
1/Werk Dausenau -1 / /
APV-Gesamt/Aachen 0 / APV-Gesamt / Aachen < correct
APV-Gesamt/Köln 0 / APV-Gesamt / Aachen
APV-Gesamt/Werk Dausenau 0 / APV-Gesamt / Aachen
cboGz_O_Q
1/Aachen 3 / 1 / Aachen < correct
1/Werk Dausenau 3 / 1 / Aachen
APV-Gesamt/Aachen 0 / APV-Gesamt / Aachen < correct
APV-Gesamt/Köln 0 / APV-Gesamt / Aachen
APV-Gesamt/Werk Dausenau 0 / APV-Gesamt / Aachen
I suppose those many wrong results depend on the internal implementation
of the combobox control and its interaction with the data source.
I need to know why
1. the listindex is set to -1 if the datasource is a linked table.
2. only the first value of StId could be selected.
Any hints about the behaviour of the combobox control is welcome.
Is there an other control which is able to solve this selection?
At least some information about my environment:
OS: WinNT 4 SP6a or WinXP (German)
Access 2002 (10.4302.4219) SP-2 (German)
ODBC: Oracle 9.02.00.06
Oracle server: 9.2.0.1.0 (language AMERICAN, territory AMERICA)
Thanks
Georg Schulte Althoff