CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    May 2008
    Posts
    18

    populate a datagrid from a text box search.

    I have no prior c++ programming experience only vbscript in asp pages, sorry to say.
    Here is what I am trying to accomplish:
    A user types in a text box (txtSearch) and then clicks a button (cmdSearch).
    From there I would like the results returned to a datagrid (DataGrid1).

    I'm using Visual C++ 6 and an access database.

    I can make the skeleton of the program in Visual C++ rather easily, though I can't seem to find a datagrid control.
    Could someone assist me in this?

    I really want to learn how to do this.

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,398

    Re: populate a datagrid from a text box search.

    Quote Originally Posted by XandarX
    ... I would like the results returned to a datagrid (DataGrid1).

    I'm using Visual C++ 6 and an access database.
    ...
    I can't seem to find a datagrid control.
    So where and how did you try to look for "datagrid control"?
    And what in this case does the DataGrid1 mean?

    Have you tried to find something useful going into Menu Project -> Add to Project -> Components and Controls -> Registered ActiveX Controls -> choose something like "DBGrid Control" or "Microsoft DataGrid Control 6.0 (SP6) (OLEDB)" or something else... (I don't know what you need and never used any grid control at all - for my purposes using the "common" ListView control was pretty good and enough)
    Victor Nijegorodov

  3. #3
    Join Date
    Feb 2002
    Posts
    3,788

    Re: populate a datagrid from a text box search.

    Quote Originally Posted by VictorN
    (I don't know what you need and never used any grid control at all - for my purposes using the "common" ListView control was pretty good and enough)
    most likely because the OP has previous VB experience and grids are really common in VB.

  4. #4
    Join Date
    May 2008
    Posts
    18

    Re: populate a datagrid from a text box search.

    got that part worked out. the control wasn't registered. found it and now it's on my form.
    DataGrid1 is the name of the datagrid control on my form.

    I need to populate it with information from an access database based on a sql query performed when the button is pressed.

  5. #5
    Join Date
    May 2008
    Posts
    18

    Re: populate a datagrid from a text box search.

    what is an "OP"?

  6. #6
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: populate a datagrid from a text box search.

    Quote Originally Posted by XandarX
    what is an "OP"?
    Original Poster - the person who started the thread.

  7. #7
    Join Date
    Oct 1999
    Location
    ks
    Posts
    523

    Re: populate a datagrid from a text box search.

    the msflexgird is also a fairly nice choice available in vc++6.0. just for s&g does anybody know what they did with msflexgrid in vc++7.0(?) that comes in vs2005? this has been driving me nuts.

  8. #8
    Join Date
    May 2008
    Posts
    18

    Re: populate a datagrid from a text box search.

    Try adding it to your toolbox. It should be listed under Com Components. Assuming you have upgraded your vc++? If you never had it on that machine I do not know that it is available with the installation. I think it's an ocx file, may be able to load it. msflxgrd.ocx

  9. #9
    Join Date
    May 2008
    Posts
    18

    Re: populate a datagrid from a text box search.

    I just realized that I switched from vc++ to vb. I'm in the wrong forum.

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