RecordSet


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: RecordSet

  1. #1
    Doug Guest

    RecordSet

    Can anyone tell me how I can use a variable (that is the name of a field
    in an Access DB), to access that particular field using a recordset?

    ex.
    rs as recordSet

    something = rs![fieldname]

    now what I need to do is change the fieldname each time the prgm accesses
    the procedure. so I've tried
    something = rs![ & variable & ] didn't work
    something = rs & "![" & variable & "]" didn't work......
    something = rs[variable] still didn't work...


    help please.....................



  2. #2
    Dennis Nagel Guest

    Re: RecordSet


    try rs.fields(FieldsName).value = "Test"

    "Doug" <doug@seisystems.com> wrote:
    > Can anyone tell me how I can use a variable (that is the name of a field
    >in an Access DB), to access that particular field using a recordset?
    >
    >ex.
    >rs as recordSet
    >
    > something = rs![fieldname]
    >
    >now what I need to do is change the fieldname each time the prgm accesses
    >the procedure. so I've tried
    > something = rs![ & variable & ] didn't work
    > something = rs & "![" & variable & "]" didn't work......
    > something = rs[variable] still didn't work...
    >
    >
    >help please.....................
    >
    >



  3. #3
    Darta Guest

    Re: RecordSet


    "Doug" <doug@seisystems.com> wrote:

    dim sFieldName as string
    sFieldName = your-dynamic-field_name-passed-in

    Get value with
    --rs.fields (sFieldName).value--

    Darta


    > Can anyone tell me how I can use a variable (that is the name of a field
    >in an Access DB), to access that particular field using a recordset?
    >
    >ex.
    >rs as recordSet
    >
    > something = rs![fieldname]
    >
    >now what I need to do is change the fieldname each time the prgm accesses
    >the procedure. so I've tried
    > something = rs![ & variable & ] didn't work
    > something = rs & "![" & variable & "]" didn't work......
    > something = rs[variable] still didn't work...
    >
    >
    >help please.....................
    >
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center