D5 ADO ORDINAL_POSITION always zero with MDAC 2.7



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


.



Relevant Pages

  • Re: Crashes on XP Home
    ... > I believe the version that still works was compiled with Delphi 6. ... I don't have a copy of WinXP Home Edition but AFAIK it does not include MDAC ... as part of it's standard components. ... application supplier installed it as part of app installation. ...
    (borland.public.delphi.non-technical)
  • Re: MDAC & MS Jet 4.0
    ... ADO and JET, you will need to make sure MDAC 27 or above and the MS Access ... > I have developed a database application with Borland Delphi 7. ...
    (microsoft.public.data.ado)
  • Either BOF or EOF is True - MDAC 2.8 - Delphi 6 SP3 - SQL2000 - Win XP
    ... I've search all the threads on this issue and all of them seem to refer only ... to Delphi 5 and MDAC 2.5. ... if commit the inserts to the database first using ...
    (borland.public.delphi.database.ado)
  • Re: NEED HELP--MDAC ADO QUESTION
    ... Most likely they just missing some component. ... Delphi is missing on a target PC. ... >closes once the form is loaded using the ADOConnection component. ... I had them download the latest MDAC 2.8 but do they also need ...
    (microsoft.public.data.ado)
  • Re: Distributing MDAC with VB Application
    ... using both DAO and ADO in your project is to be SURE to qualify object names ... > Is there something else I need to include if using MDAC 2.5 or higher? ... include the Jet components ADO requires. ... you might have to distribute the Jet Components installer. ...
    (microsoft.public.vb.winapi)