PHD
asked on
adodataset insert record
Hello,
I use a database MS SQL.
I try to insert records between two others and get the result in a dbgrid.
First I select a row in the dbgrid.
By pressing a button, the program execute : tadodataset(wwDBGrid1.Data
My form contains tdbedit controls bound to the dataset via a datasource. I enter values in each dbedit controls.
then by pressing another button, it execute : tadodataset(wwDBGrid1.Data
When I execute this code, the record is added at the end of the dataset as an append statement.
How can I do without have to add another database field ?
If you mean without the DBEdits ...
wwDBGrid1.DataSource.DataS
wwDBGrid1.DataSource.DataS
wwDBGrid1.DataSource.DataS
wwDBGrid1.DataSource.DataS
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
"How can I do without have to add another database field ?"
Please clarify...
I mean without a field in my table specifying the order of the record and then make an order by clause.
Please clarify...
I mean without a field in my table specifying the order of the record and then make an order by clause.
By pressing a button, the program will execute : tadodataset(wwDBGrid1.Data Source.Dat aSet).Edit ;
You change values in some or all dbedit controls.
then by pressing another button, it execute : tadodataset(wwDBGrid1.Data Source.Dat aSet).Post ;
When you execute this code, the record will update the current record of the dataset.
This will not append a new record.
You change values in some or all dbedit controls.
then by pressing another button, it execute : tadodataset(wwDBGrid1.Data
When you execute this code, the record will update the current record of the dataset.
This will not append a new record.
ASKER
I think, Ihave the solution based on the comment of 'esoftbg'.
I make an edit at current position with the new record to insert and then I set the ID of all next records +1
My table should be ordered as expected
Thanks for all, I try this.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
"How can I do without have to add another database field ?"
Please clarify...