Using SEEK on DBF files and indexes 
Author Message
 Using SEEK on DBF files and indexes

Hello out there,

I have got a question about handling dBASE indexes in VB5.

The problem:
I am opening a dBASE III table directly using the OpenDatabase method.
The dbf file contains several indexes (not created by VB5) of which index 2
consists of 2 attributes. Using the seek method never gives me a proper
result.

Going into this problem I found something strange.
When I look into the index file using notepad I see the following first
line:

  ?^      _ _   _     STR(SOFINR,9) + STR(ANR,10)

The two attributes SOFINR and ANR are in the correct order and with the
correct length.

When I use the tabledefs and indexes in VB to determine what indexes are
present and which attributes the indexes consists of I get the following:

td.Indexes(1).Fields = "+ANR;+SOFINR"

The attributes are not in the proper expected order.
Could this be the reason I do not find any data?
Using Dbase there are no problems.

As a test i created an extra index on the file using the following VB
statements.

Set id = td.CreateIndex("test#003")
id.Fields.Append id.CreateField("Sofinr")
id.Fields.Append id.CreateField("Anr")
td.Indexes.Append id
td.Indexes.Refresh

Looking into the created index file test.003 shows the following first line:

__  X^   C  _ _   _ _   STR(SOFINR,9,0)+STR(ANR,10,0)

Using VB to show me the attributes of the index gives me the following info:

td.Indexes(2).Fields = "+SOFINR;+ANR"
This is OK.
Using this index in VB gives me proper results.

Is this a VB bug?
Any ideas?

Thanks in advance

Robert-Jan van Diest



Sun, 15 Apr 2001 03:00:00 GMT  
 Using SEEK on DBF files and indexes
Sorry, but DAO cannot use dbase indexes which are based on
expressions, as yours appears to do.

-- Jim Ferguson, FMS
   http://www.fmsinc.com



Sun, 15 Apr 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. using Clipper DBF files with NTX indexes

2. PLEASE HELP - Indexes Creating CDX files for FoxPro 2.x DBF's Using VB4.0

3. Using SEEK with MDB vs DBF

4. Using SEEK with MDB vs DBF

5. Using Seek to improve dbf search speed.

6. using .index and .seek function

7. dbf files indexed with clipper and access

8. DBF index file layout - please help

9. Indexing & accessing a DBF file

10. dbf files and indexes

11. .dbf files, indexes and VB

12. dbf files indexed with clipper and access97

 

 
Powered by phpBB® Forum Software