Is ADO.net and VFPOLEDB compatible with Fox 2.6 index files.

  • Thread starter Thread starter Stéphane STASSIN
  • Start date Start date
S

Stéphane STASSIN

HI.

I am trying to transform an old application in FoxPro 2.6 into a VB.net
application.
I use Ado.net with the last VFPOLEDB driver.

I am opening a DBF File and his .idx file index by doing : "USE
c:\mytable.dbf INDEX c:\myindex.idx" into a dataset and his dataadpater.

My two questions are :

1 - can i use the commandbuilder to generate the updatecommand ,
supposing i have a unique INDEX defined in my idx.
2 - are all the .idx files opened with the table up to date when i am
inserting or deleting rows.
 
In [email protected],
Stéphane STASSIN said:
I am trying to transform an old application in FoxPro 2.6 into a
VB.net application.
I use Ado.net with the last VFPOLEDB driver.

I am opening a DBF File and his .idx file index by doing : "USE
c:\mytable.dbf INDEX c:\myindex.idx" into a dataset and his
dataadpater.
1 - can i use the commandbuilder to generate the updatecommand ,
supposing i have a unique INDEX defined in my idx.
2 - are all the .idx files opened with the table up to date when
i am inserting or deleting rows.

Hi Stéphane,

FoxPro has two types of index files, IDX files which contain only one index
expression and CDX or compound index files that can contain indexes for more
than one different expression. When CDX files are opened and updated the CDX
file is also updated, without any extra commands, including updates through
ODBC and OLE DB.

IDX files, on the other hand, are not opened automatically and not updated
automatically. In fact, I have not yet found a way to update IDX files
automatically when records are added/updated.

As for "unique" indexes, when FoxPro index is defined with the UNIQUE
keyword (INDEX ON Field1 TO Field1Idx.idx UNIQUE), it has the effect of
"hiding" any records with duplicate values. The duplicates are still in the
table, even though they are hidden. This is entirely different than a
typical primary key where the data engine will not allow duplicate values if
an index (in a Visual FoxPro table's CDX file) is defined to be the primary
key or a candidate key. Most FoxPro and Visual FoxPro developers avoid
UNIQUE indexes.
 
Hi Thanks Cindy.

After spending hours an hours seachinrg a way to update IDX, and also after
your anwser, il have decide to give up the idea to maintain IDX on our "old"
database an update to CDX.

Thank a lot for your help.
 
Back
Top