Marc
Your queries should not be that slow especially if you are crafting your Sql statement to only return 100 or so rows.
Also, as Enrico mentioned .. Select * from any table is expensive and the only reason I Select * from any table is if I need to edit the record.
There are ways you can enhance your performance .. consider this psudo code if you use a browse to edit coding cycle ..
// use this for your browse to select a record to edit where [field1] is the unique key
// primary key and only select fields that need to be viewed in a listbox
- Code: Select all Expand view
cSql := "Select [field1],[field2],[field3] from [My Table] order by [field1]" // only fields we
// need to see
oRs := TOleAuto():New( "ADODB.Recordset" )
oRs:CursorType := 1 // opendkeyset
oRs:CursorLocation := 3 // local cache
oRs:LockType := 3 // lockoportunistic
TRY
oRs:Open( cSQL, Your_Connection_String )
CATCH oErr
Saying := "Error in Opening table"
MsgInfo( Saying )
RETURN(.F.)
END TRY
// user selects record from listbox and it returns the unique primary key cKey
// here is the performance trick
// you do not have to reload the object
oRs:CLose()
cSql := "Select * from [Table] where [Field1] = '"+cKey+"'"
TRY
oRs:Open( cSQL, Your_Connection_String )
CATCH oErr
Saying := "Error in Opening table to edit record"
MsgInfo( Saying )
RETURN(.F.)
END TRY
// edit your record
oRs:CLose()
oRs := Nil
The point I am suggesting is to only Select the minimum [Fields] in your Sql statement, then close and reopen the row you want to edit.
Hope that helps
Rick Lipkin