Subs / Functions vs rs("value")

Results 1 to 3 of 3

Thread: Subs / Functions vs rs("value")

  1. #1
    Dave W Guest

    Default Subs / Functions vs rs("value")

    IS there any advantages to using a sub to specify a value to be saved / got from database?<BR><BR>eg:<BR><BR>Sub GetRs(FieldIn,ValueIn)<BR>FieldIn = objRs.fields.item(ValueIn).Value<BR>End Sub <BR><BR>Call GetRs(ActualField,"ActualValue")<BR><BR>vs :<BR><BR>ActualField = objRs.fields.item("ActualValue").Value<BR><BR>Is there any performance advantage to be gained, or is it more of a readability issue?<BR><BR>TIA<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default in africa ..

    in africa there are 3 different prices. 1.white 2. indian 3. african<BR><BR>similarly here<BR>calling a sub is more expensive than x = rs("fld1").value<BR><BR>and x = rs("fld1").value is more expensive than x = rs(1).value<BR>(ordinal number)<BR><BR>expensive in terms of processing time.<BR>

  3. #3
    Linda Pyrc Guest

    Default RE: Subs / Functions vs rs(

    There is only ever an advantage of using a Sub for any code that involves more than 1 line of code that will be commonly used.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts