Updating fields after SQL query 
Author Message
 Updating fields after SQL query

Hi all, hoping for some help before my head explodes....

..I have created a VB DataProject linked to a SQL database. The
environment has a SQL query that runs on startup and populates a form
and a DataGrid - This all works okay.

I can also change the SQL query statement inside the VB program and
re-run it, which appears to work okay as the .RecordCount alters
accordingly - but the text fields linked to the data and the DataGrid
are not updated with the new information. I have tried everything I
can think of to re-refresh the form fields with no success.....Please
help :-)

Cheers
Adrian



Sun, 26 Dec 2004 21:31:08 GMT  
 Updating fields after SQL query
Adrian,

Disconnect grid from the recordset and rebind it:
set grd.datasource = nothing
set grd.datasource = deX.rsY

Rob



Quote:
> Hi all, hoping for some help before my head explodes....

> ..I have created a VB DataProject linked to a SQL database. The
> environment has a SQL query that runs on startup and populates a form
> and a DataGrid - This all works okay.

> I can also change the SQL query statement inside the VB program and
> re-run it, which appears to work okay as the .RecordCount alters
> accordingly - but the text fields linked to the data and the DataGrid
> are not updated with the new information. I have tried everything I
> can think of to re-refresh the form fields with no success.....Please
> help :-)

> Cheers
> Adrian



Mon, 27 Dec 2004 04:47:57 GMT  
 Updating fields after SQL query
If you use data control for the grid you should set Default type = 2-UseJet
in design


Mon, 27 Dec 2004 14:45:40 GMT  
 Updating fields after SQL query
That's excellent, thanks Rob.
Works perfect for the DataGrid - I also tried it on the text boxes
linked to the same data and it works fine (although I would have
thought Microsoft could have implemented the links to work
automatically)..

Cheers
Adrian



Mon, 27 Dec 2004 16:47:30 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. How to update calculated fields in SQL query?

2. 2nd SQL Server update after update text field corrupts row - using RDO

3. Updating data to a memo field using SQL UPDATE

4. inserting character in an access field by using an update query

5. Update query - unknown field name

6. Update Queries for Date/Time fields

7. Update Query Field based on Date Series

8. Update Query-Empty fields

9. Update query on key field

10. Can't update fields in Join Query

11. Populating memo field using update query from VB5

12. Want to perform update query with SQL??

 

 
Powered by phpBB® Forum Software