Re: Reading data via field names vs ordinals
From: Paul Clement (UseAdddressAtEndofMessage_at_swspectrum.com)
Date: 04/19/04
- Next message: Matt Creely: "Master/Detail Transactions"
- Previous message: Paul Clement: "Re: problem while connecting to a secured MS Assess DB"
- In reply to: tinman: "Reading data via field names vs ordinals"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 19 Apr 2004 09:24:58 -0500
On Mon, 19 Apr 2004 11:54:44 +0700, "tinman" <dwesar@yahoo.com> wrote:
¤ Hi...
¤
¤ Is it better to access the data via its ordinal or field name?
¤
¤ For example, is Option A or B the preferred way ? My concern here is what
¤ will
¤ happen if the resultset order changes?
¤
¤ Option A:
¤
¤ While ProjectData.Read
¤ m_ProjectName = ProjectData("proj_name")
¤ m_ProjectType = ProjectData("type")
¤ m_Reason = ProjectData("reason")
¤ End While
¤
¤
¤ Option B:
¤
¤ With ProjectData
¤ While .Read
¤ m_ProjectName = .Item("1")
¤ m_ProjectType = .Item("2")
¤ m_Reason = .Item("3")
¤ End While
¤ End With
¤
I would not trade-off the small performance enhancement when using ordinals for code readability.
Paul ~~~ pclement@ameritech.net
Microsoft MVP (Visual Basic)
- Next message: Matt Creely: "Master/Detail Transactions"
- Previous message: Paul Clement: "Re: problem while connecting to a secured MS Assess DB"
- In reply to: tinman: "Reading data via field names vs ordinals"
- Messages sorted by: [ date ] [ thread ]