Results 1 to 4 of 4

Thread: adodc -> variable

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2008
    Posts
    10

    Question adodc -> variable

    hey guys i have really simple question:
    i make db in access, i can control it by adodc and datagrid, i know how to add new recordset,
    i just cant get one thing:
    how to return(export maybe) a value from database field to a variable?
    or how to edit database using adodc1 and code ("click and edit" in datagrid is useless, i need to do it by code)

    try to make it simple, I'm still a rookie in vb

    kind regards

    edit: i use vb 6.0
    Last edited by helac; Jan 27th, 2009 at 04:09 PM.

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: adodc -> variable

    The ADODC control has a Recordset property. Use the Recordset.Fields collection to access the values of the current record.

    strData = ADODC1.Recordset.Fields("FieldName").Value
    strData = UCase$(strData)

    ADODC1.Recordset.Fields("FieldName").Value = strData
    ADODC1.Recordset.Fields("AnotherField").Value = 734.23

    ADODC1.Recordset.Update

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2008
    Posts
    10

    Re: adodc -> variable

    thanks alot
    that was exactly what i was looking for
    just one more question:

    strData = UCase$(strData)
    why to make string to upper case?

    kind regards

  4. #4
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: adodc -> variable

    I think brucevde was simply trying to show you that if you ran the code, the upper case value will appear in your updated recordset.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

Posting Permissions

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



Click Here to Expand Forum to Full Width