 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Sven Pran Guest
|
Posted: Mon Oct 16, 2006 1:15 am Post subject: edit and/or insert records in TADODataset |
|
|
I have a table from an Access database displayed in a
DBGrid. I am using the components: TADOConnection,
TADODataSet, TDataSource, TDBGrid and TDBNavigator,
and my platform is BDS2006 for Win32.
DBNavigator allows me to delete a selected record.
It also allows me to insert a new record but I have so far
found no way to enter data into any of the fields in this
new record and when I try to complete the action I get the
obvious message that I cannot insert a record without any
data.
I suppose it is the same problem when I have not found
any way of editing the data in a field in a selected
record. (I do it with SQL UPDATE statements on the table
as a whole, but in some cases I need to do it on individually
selected record fields like editing cells in a datasheet.)
I should appreciate some "quick-start" advice, both on
how to select a field rather than the complete row in
DBGrid, and also on how to edit record fields.
regards Sven |
|
| Back to top |
|
 |
Bill Todd Guest
|
Posted: Mon Oct 16, 2006 3:33 am Post subject: Re: edit and/or insert records in TADODataset |
|
|
I have not worked with Acess for years but you should be able to edit
data in the DBGrid by selecting a cell and typing. Make sure that the
AutoEdit property of the DataSet is set to true (the default). If you
cannot enter data in a new record or change data in an existing record
tell us exactly what happens when you try to do so including the exact
text of any error message.
--
Bill Todd (TeamB) |
|
| Back to top |
|
 |
Bill Todd Guest
|
Posted: Mon Oct 16, 2006 6:15 am Post subject: Re: edit and/or insert records in TADODataset |
|
|
Also, if you cannot edit post your SQL SELECT statement and the
metadata for the table.
--
Bill Todd (TeamB) |
|
| Back to top |
|
 |
Sven Pran Guest
|
Posted: Mon Oct 16, 2006 8:10 am Post subject: Re: edit and/or insert records in TADODataset |
|
|
"Bill Todd" <no (AT) no (DOT) com> wrote in message
news:4532b734$1 (AT) newsgroups (DOT) borland.com...
| Quote: | I have not worked with Acess for years but you should be able to edit
data in the DBGrid by selecting a cell and typing. Make sure that the
AutoEdit property of the DataSet is set to true (the default). If you
cannot enter data in a new record or change data in an existing record
tell us exactly what happens when you try to do so including the exact
text of any error message.
--
Bill Todd (TeamB)
|
Thanks,
Initially I have probably overlooked something in the properties of
DBGrid because I can only select the whole row, not an individual cell.
These are the DBGrid options selected: (More or less default)
Options = [dgTitles, dgIndicator, dgColumnResize, dgColLines,
dgRowLines, dgTabs, dgRowSelect, dgConfirmDelete, dgCancelOnExit]
In the ADODataset definition I now have CommandType = cmdTableDirect,
I have tried cmdTable and cmdText with SQL select statements, for
instance SELECT * FROM tablename.
Anything not mentioned here is probably irrelevant for my "problem"
(like font and title specifications) or default in BDS2006
I shall be away for a week, probably unable to look up answers until Friday.
regards Sven |
|
| Back to top |
|
 |
Bill Todd Guest
|
Posted: Mon Oct 16, 2006 5:42 pm Post subject: Re: edit and/or insert records in TADODataset |
|
|
Remove dgRowSelect.
--
Bill Todd (TeamB) |
|
| Back to top |
|
 |
Sven Pran Guest
|
Posted: Fri Oct 20, 2006 3:12 pm Post subject: Re: edit and/or insert records in TADODataset |
|
|
"Bill Todd" <no (AT) no (DOT) com> wrote in message
news:45337e34$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Remove dgRowSelect.
--
Bill Todd (TeamB)
|
Right!
I have been away for some days and one evening I
sat down with my computer to see if I could get any
further.
Suddenly I got the idea first to remove dgRowSelect
which did not help. Then I noticed dgEditing which I
could not make "true" and finally I combined the two
changes.
Thanks for your help!
regards Sven |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|