
Can not keep FoxPro 2.5 index (.CDX) open
I have been trying to use a foxpro index (.cdx) with my app. but have
been havin trouble keeping the index file open. I have created an INF
file (CDB.INF) that looks like this:
CDX1=CDB.CDX
I also created one that looked like this:
[FoxPro 2.5]
CDX1=CDB.CDX
When I look at the file open activity with RConsole, I can see the .DBF,
.INF and the .CDX open. Then, as quickly as the .CDX opens, it closes
along with the .INF. I would expect the .INF to close, but not the .CDX.
Has anyone else experienced this and, if you have, do you have a solution
as to what I am doing wrong?
Another question I have is, if I can keep the .CDX open, how do I set the
tag?
I have been looking all over for the answer (Knowledge base, MSDN CD's,
etc.) but I haven't been able to find anything. Any help/insight would
be greatly appreciated. Part of the program follows.
Thanks,
Barron.
This is the program I have been using to experiment with. Not much is
happening here, just open the database and print the first 4 records on
the form.
Sub Form_Load ()
Dim Db As database
Dim tb As table
Dim i As Integer
Set Db = OpenDatabase("\dbdir", False, False, "FoxPro 2.5;")
Set tb = Db.OpenTable("cdb")
form1.Show
For i = 0 To 4
Print tb(0) & " " & tb(1)' & " " & tb(3) & tb(4)
tb.MoveNext
Next
tb.Close
End Sub