Re: Adding records via datagrid

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Ralph

if it helps then ...

I use ADO. Mt datasource is Access, and I have been using the old MSAccess
driver rather than Jet OLEDB. I changed over the to the JET driver
temporarily, but it gave me all sorts of problems with the DataGrid (reported
on the ADO newsgroup, but never satisfactorily answered.)

I create an ADODC and link it to the datagrid on my form to allow me to pull
in field names from an underlying table, select visible columns and set
properties etc. I then remove the ADODC and datagrid reference. In code I
do what ever selections and filters I want to on the underlying table and set
it as the grid's datasource.

I'm not sure how elegant and efficient this is, but it seems to work.


--
UK John


"Ralph" wrote:


"JohnBury" <JohnBury@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:62F156E1-0E0C-4538-B302-922A9A57769B@xxxxxxxxxxxxxxxx
I want to use a datagrid to add records to a table.

The table is filtered and bound to the grid.

I want the user to add one or more records to the grid and for these to be
written to the underlying table, and linked back to an owning record.

I have been able to do everything I want to do apart from making it wholly
intuitive.

The behaviour of the grid (I think) is a bit odd!

I can add new data in the 'new' record row. What I can't do is find an
easy
(and intuitive) way for the grid to offer up a further new record row. I
have to click on another record or force a refresh of the datagrid, before
it
will go through its update action, write the record away and then offer a
new
entry row.

How can I either:
1) detect that I have completed my record entry and force the control to
update the table a give me a new row, or

2) generate a new blank row as soon as I begin to add new data (I think MS
Access works like this!)

I don't really want to have to use other controls and assocaited code as
this seems to devalue the use of a bound control!

Any help please

John

The school children of Bolton await your wisdom!
--
UK John


I lost track. Are you using ADO or DAO?
DataGrid sp?

-ralph



.



Relevant Pages

  • Re: Refresh Linked Tables - ADO
    ... Is there another way to test if a table is indeed a linked table with ADO? ... Jet OLEDB: Link Datasource property, but it also sets the Jet OLEDB: ... Doug Steele, Microsoft Access MVP ... Set catDB = CreateObject ...
    (microsoft.public.access.formscoding)
  • Errata
    ... obviously the place for "classic" ADO questions). ... > If you are trying to update a .Net datagrid that contains a dataset with ... > If you are talking about a "classic" ADO recordset, ... >> query returns a recordset containing a lookup field from a related ...
    (microsoft.public.vb.database.ado)
  • Re: Problem updating a record containing a negative Value
    ... If it is the same in ADO or ADO.NET then this is definitely a bug in ODBC ... driver from the vendor. ...
    (microsoft.public.data.ado)
  • Re: Compile error with #import
    ... no ADO and no database access in the kernel. ... > I'm trying to access an SQL Server from my driver using ADO, ... > to my file I get compile errors. ...
    (microsoft.public.development.device.drivers)
  • Re: Sp_CursorOpen,Fetch,Close
    ... JDBC drivers can and do use the sp_cursor stored procedures just as ADO ... The JDBC equivalent for the ADO CacheSize property is "fetch size". ... the MS JDBC driver choses to ignore it. ...
    (microsoft.public.sqlserver.jdbcdriver)