PDA

Click to See Complete Forum and Search --> : Data grid & ADO


J Staniforth
Apr 5th, 2000, 09:40 PM
I have set a datagrid to link to db via ADO. Problem is that in code part of its underlying record is updated directly - but this does not get reflected in the datagrid.
Is there a command which will update the datagrid with current data in the underlying tables.

pardede
Apr 6th, 2000, 06:09 AM
DBgrid1.Refresh will do the trick...

J Staniforth
Apr 6th, 2000, 08:57 PM
The grid is based on a DED command with child command.
The child command is query joining two tables. The first holding each child/detail row for the master record ON THE FORM. The second table holds the look ups. So on the detail record there is a foreign key for the type of item we are dealing with. The lookup holds the full description.
When the code sets a new foreign key this query obviously doesnt refresh - despite my best efforts!!
Please, please, please help!!!
Thanks

pardede
Apr 7th, 2000, 03:49 AM
Sorry, I didn't realize you were using ADO, yes this is a known symptom. You need to rebind your control by resetting the datasource property to the command. Discussion on this subject you can see here in this page:

http://support.microsoft.com/support/kb/articles/Q191/4/57.ASP

[Edited by pardede on 04-10-2000 at 09:21 AM]

pardede
Apr 10th, 2000, 10:33 PM
Glad it helped, at least as far as it went ;)

For your new question: I have so far only came across the error you mentioned once in the hectic of coding, but never able to reproduce it. If you would post some code or take a look (by step-debugging) exactly where the error occurs maybe I can help look for the cause.

J Staniforth
Apr 11th, 2000, 03:23 PM
Thought you might like to know...
Found the bug!!
As part of my emulation of drop-downs (and other things) in the DataGrid I use a variable to hold a copy from the DED of the recordset and on inspection I found that this defaults to static cursor etc.