CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2008
    Posts
    74

    how set object using var?

    hi,
    i want to this using values from db i using vb6

    dim object_name

    set object_name = command1

    i want load the name "command1" from the db and do something
    like this:

    set object_name = value_from_db

    it this possible?
    thanks a lot for your help

  2. #2
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,725

    Re: how set object using var?

    It is very vague at all, what your project is.
    db... do you mean a database?
    What value could that be you want to retrieve, of which table, which record, which field name?
    You should study ADO controls and objects which, in a very far away and loosely vague fassion ressemble to the things you suggest you want to do.
    There is a "Command" object which allows to retrieve values, or better say records, from a database.

    Let me answer this shortly: It is possible.
    But not directly in the way you are suggesting to do it.
    You'd have to use a Connection object to link to the database, a Command object to execute a query (sometimes it goes without command object), and a Recordset object to hold your resulting records. THEN you have to know how to find the value_from_db you want.

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

Featured