
dBASE Index files .MDX usage in VB
Does VB 4.0 Use the Indexes from the .MDX index file for attached
DBF (dBASE IV) database files in SQL queries, which return
data in Recordsets.
My concern is that the Tables I am querying to return records
can be huge, and hence, the queries returning records to my
Recordset can take a long, long time.
Here is some of my VB code:
'*** DataDirname = "C:\KRONOS\TEM\DATA"
'*** ConnDBF = "dBASE IV; DATABASE=*.DBF;"
Set db_TKC = OpenDatabase(DataDirname, False, True, ConnDBF)
psched$ = Trim(rec_emp("psched"))
SQLStmt$ = "Select SCHSHIFT.* From SCHSHIFT Where PSCHED='" & psched$
& "';"
Set rec_schshift = db_TKC.OpenRecordset(SQLStmt$, dbOpenSnapshot)
I have another Recordset that should use an .MDX index file with
a tag that is a composite key index: EMPNUM + Str(SHID). The
code looks as follows:
SQLStmt$ = "Select EMPSHIFT.ADATE From EMPSHIFT Where EMPNUM = '" _
& gvGLB_UserID$ & "' And SHID = " & "Val(" & ShiftId$ &
");"
Set rec_empshift = db_TKC.OpenRecordset(SQLStmt$, dbOpenSnapshot)
Do both SQL queries use the Index file tags to return records? If my
syntax is wrong, than how can I make sure that the query is actually
using the indexes in the .MDX files.
Thanks,