|
-
May 14th, 2009, 06:07 AM
#1
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!
-
May 14th, 2009, 07:13 AM
#2
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.
-
May 14th, 2009, 10:55 AM
#3
Re: Any database recordset helper control
Is there such an Activex control ? Thanks!
-
May 14th, 2009, 11:40 AM
#4
Re: Any database recordset helper control
 Originally Posted by forester
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.
-
May 14th, 2009, 12:07 PM
#5
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.
-
May 14th, 2009, 03:53 PM
#6
Re: Any database recordset helper control
 Originally Posted by Skizmo
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.
-
May 14th, 2009, 03:57 PM
#7
Re: Any database recordset helper control
 Originally Posted by CNemo
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.
-
May 14th, 2009, 04:16 PM
#8
Re: Any database recordset helper control
 Originally Posted by GCDEF
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.
-
May 14th, 2009, 04:47 PM
#9
Re: Any database recordset helper control
 Originally Posted by CNemo
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.
-
May 14th, 2009, 08:53 PM
#10
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.
-
May 15th, 2009, 12:26 AM
#11
Re: Any database recordset helper control
 Originally Posted by GCDEF
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.
-
May 15th, 2009, 12:36 AM
#12
Re: Any database recordset helper control
 Originally Posted by forester
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.
-
May 15th, 2009, 03:00 AM
#13
Re: Any database recordset helper control
 Originally Posted by CNemo
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
-
May 18th, 2009, 10:21 PM
#14
Re: Any database recordset helper control
 Originally Posted by VictorN
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|