D5 ADO ORDINAL_POSITION always zero with MDAC 2.7
- From: "mIKE" <doyouknowverhagen@xxxxxxxx>
- Date: Thu, 21 Jul 2005 03:32:39 -0600
D5 with ADOExpress, under WXP vs. W2K, MDAC 2.7 vs. MDAC earlier
I use Connection.OpenSchema to retrieve table & field data from an ADO
connection. This all works well on my W2K machine because it has a version
of MDAC prior to 2.7.
On the WXP machines with MDAC 2.7 or higher, the ORDINAL_POSITION value is
always 0, so I cannot sort the resulting display by that data. I understand
that this also creates other problems, but I haven't encountered any myself
that I've traced to this bug.
Searching on Tamaracka with the clue ^delphi openschema ordinal, I found a
message on 11/1/2001 that mentioned the same problem, and proposed this
work-around in the Delphi code for TCustomADODataSet.UpdateIndexDefs:
The old line is this:
if TagVariant(IndexInfo.Fields[SOrdinalPosition].Value).ulVal > 1
then
The new line is this:
if IndexDefs.IndexOf(VarToStr(IndexInfo.Fields[SIndexName].Value))
<> -1 then
Other old messages seem to indicate that there are still some problems with
what ADO provides or Delphi expects even in D6.
My questions are these:
1) Is there a later version of Delphi that doesn't exhibit this problem?
2) If the answer to #1 is yes, then what Delphi version and level do I need
to get that includes this fix and a substitute for ADOExpress?
3) No matter the answer to #1, do you think it's reasonable to change this
D5 code myself, and can you give pointers about how to manage this?
4) Any other suggestions?
In case you want to test this, here's the code I use:
Connection1.OpenSchema(siColumns, VarArrayOf([unassigned,unassigned,
YourTableNameHere ,unassigned]), EmptyParam, RS);
RS.FieldByName('ORDINAL_POSITION').AsString always returns '0' with
MDAC 2.7
mIKE
.
- Follow-Ups:
- Re: D5 ADO ORDINAL_POSITION always zero with MDAC 2.7
- From: Brian Bushay TeamB
- Re: D5 ADO ORDINAL_POSITION always zero with MDAC 2.7
- Prev by Date: Using ADO to connect to Outlook/Exchange
- Next by Date: Arguments are of the wrong type, are out of acceptable range or are in conflict with one another
- Previous by thread: Using ADO to connect to Outlook/Exchange
- Next by thread: Re: D5 ADO ORDINAL_POSITION always zero with MDAC 2.7
- Index(es):
Relevant Pages
|