CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 14 of 14
  1. #1
    Join Date
    Jan 2003
    Posts
    379

    Any database recordset helper control

    In my database program, I need a control that list records in the recordset, it can move next, previous, first and end, and it can add new, delete and modify record, Who knows is there such a control, Thanks!

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

    Re: Any database recordset helper control

    I don't know if there's a control, but look at CRecordView.

    Seems like it would be pretty trivial to do it with a dialog too.

  3. #3
    Join Date
    Jan 2003
    Posts
    379

    Re: Any database recordset helper control

    Is there such an Activex control ? Thanks!

  4. #4
    Join Date
    Apr 2009
    Posts
    57

    Re: Any database recordset helper control

    Quote Originally Posted by forester View Post
    In my database program, I need a control that list records in the recordset, it can move next, previous, first and end, and it can add new, delete and modify record, Who knows is there such a control, Thanks!

    How could such a control exist? It would have to know what the name and properties of your fields ahead of time!!!


    There are some activex grid controls that would list your fields for you given an sql statement.

    And you can use SQL to ADD, DELETE, UPDATE.

    ... there might be a control that returns the text value of fields given an SQL statement, then you can use Cwnd::SetWindowText and place the value in Edit controls.

    No matter what, you still have to do some programing, there is no control that you give a table and after placing it in a dialog box it creates all the functionality that you are asking for.

    Like I said, using SQL is you best bet, however getting the field values into text format can be a little messy unless you find a control to do it for you: You can write it yourself, but it's a little work, it won't kill you, but it will be a little time consuming the first time.

  5. #5
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: Any database recordset helper control

    How could such a control exist? It would have to know what the name and properties of your fields ahead of time!!!
    With SQL you can ask this kind of stuff from the database... to be honest.. it is not that hard to make a activex control that does what forester wants.

  6. #6
    Join Date
    Apr 2009
    Posts
    57

    Re: Any database recordset helper control

    Quote Originally Posted by Skizmo View Post
    With SQL you can ask this kind of stuff from the database... to be honest.. it is not that hard to make a activex control that does what forester wants.
    Can you do one and post it? It shouldn't take that long right.

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

    Re: Any database recordset helper control

    Quote Originally Posted by CNemo View Post
    Can you do one and post it? It shouldn't take that long right.
    It really wouldn't be that big a deal. It's more than somebody would want to do just to prove a point, but it shouldn't take more than a few days.

  8. #8
    Join Date
    Apr 2009
    Posts
    57

    Re: Any database recordset helper control

    Quote Originally Posted by GCDEF View Post
    It really wouldn't be that big a deal. It's more than somebody would want to do just to prove a point, but it shouldn't take more than a few days.
    Hmm, he made it sound like it would only take a few minutes

    In that case is would be simpler to just create a dialog box with sql statements and buttons. That should only take about 3-4 hours.

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

    Re: Any database recordset helper control

    Quote Originally Posted by CNemo View Post
    Hmm, he made it sound like it would only take a few minutes

    In that case is would be simpler to just create a dialog box with sql statements and buttons. That should only take about 3-4 hours.
    That's what I said in the first reply.

  10. #10
    Join Date
    Jan 2003
    Posts
    379

    Re: Any database recordset helper control

    Thank you for your replies!

    If I try to use ActiveX grid controls, what are the most powerful ActiveX controls, where can I get them?

    If there are add new, delete and modify buttons on the ActiveX control, that's better, then I only need to run the corresponding add new, delete and update SQL command, no need to process the user interface matters such as adding button and icon resoures, or adding a new row in the list or grid etc. The Microsoft datagrid control version 6.0 provided in VC6 has no such buttons, there are only move next, previous, first and end buttons on it.

    If there is such an ActiveX control, it will save a lot of time in database program developing. Thanks!
    Last edited by forester; May 14th, 2009 at 08:55 PM.

  11. #11
    Join Date
    Apr 2009
    Posts
    57

    Re: Any database recordset helper control

    Quote Originally Posted by GCDEF View Post
    That's what I said in the first reply.
    Well, CFormView is more of a problem than a solution. I tried using it at first and it has a ton of problems. Memo fields are limited to the amount of text they can pass unless you go in and hack the code.

    CFormView doesn't work in dialog boxes, so if you want to edit a Database in a dialog box your out of luck. When you want to work with more than One Table or Database in a form/dialog box, CFormView is even more of a hassle.


    I'm talking about using CRecordSet, CDaoRecordset or ado in a diaog box with sql access methods.

    CFormview is ok if you just want to work with One Table of a database, and even then it's very limited.

  12. #12
    Join Date
    Apr 2009
    Posts
    57

    Re: Any database recordset helper control

    Quote Originally Posted by forester View Post
    Thank you for your replies!

    If I try to use ActiveX grid controls, what are the most powerful ActiveX controls, where can I get them?

    If there are add new, delete and modify buttons on the ActiveX control, that's better, then I only need to run the corresponding add new, delete and update SQL command, no need to process the user interface matters such as adding button and icon resoures, or adding a new row in the list or grid etc. The Microsoft datagrid control version 6.0 provided in VC6 has no such buttons, there are only move next, previous, first and end buttons on it.

    If there is such an ActiveX control, it will save a lot of time in database program developing. Thanks!
    Well if the control executes a SQL statement then that's all you need.

    I don't have MSDN in front of me, but there is a command something like CRecordset::Execute which will run a SQL command on a DATABSE, it only takes about 4 lines of code to open the database, execute the sql and close the data base.

    4 Lines of Code in a member function and 3 sql statements for a Adding, Deleting, Updating should do the trick. ... or find a ActiveX control that executes a sql statement on a given database: ... or just write you own.

    DataGrid and what I just said above should do the trick.

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

    Re: Any database recordset helper control

    Quote Originally Posted by CNemo View Post
    Well, CFormView is more of a problem than a solution. I tried using it at first and it has a ton of problems. Memo fields are limited to the amount of text they can pass unless you go in and hack the code. ...
    Did you really mean CFormView class?
    Or it was just a typo and you referred to CRecordView?
    Victor Nijegorodov

  14. #14
    Join Date
    Apr 2009
    Posts
    57

    Re: Any database recordset helper control

    Quote Originally Posted by VictorN View Post
    Did you really mean CFormView class?
    Or it was just a typo and you referred to CRecordView?
    Yep, sorry, I ment CRecordView (sort of look alike, but different under the hood)

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