It all depends on how you deal with the records once you have
selected them as to whether or not this matters.
If you do myValue = recordset.field("fieldName"), then you take a
slight speed hit but also get future proofing against field re-ordering
If you do myValue = recordset.idxFiled(fieldNumber), then you get a
speed increase, and future proofing against field re-naming.
I prefer to develop using option 1, and then when I'm finished go
through and convert all queries to option 2 as a final optimisation.
I do this because I sometimes find the need to add fields to and
change the
order of fields in my backend as I develop my front end, plus it
makes my code easier to read while I'm debugging and optimising.
- Tom
On 18/01/2007, at 1:34 PM, Roger Clary wrote:
On Jan 17, 2007, at 9:28 PM, Craig A. Finseth wrote:
Dim rs AS recordset
rs = App.QMPdata.SQLSelect("SELECT * FROM TakeData WHERE TestNm
= '"
+ myTest + "' OR TestNm = '" + altTest + "'")
Try:
rs = App.QMPdata.SQLSelect("SELECT * FROM TakeData WHERE
(TestNm = '"
+ myTest + "' OR TestNm = '" + altTest + "');")
Note the extra parentheses.
Also, for anything other than quick interactive playing with SQL,
never do "Select *". Instead, do:
Select ( column1, column2, ... ) ...
as "Select *" results will change if you ever modify the table
structure.
Thanks, Craig. I didn't know this.
Roger M. Clary
Class One Software
http://www.classonesoftware.com
[EMAIL PROTECTED]
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>