# Cannot edit the datagrid in VB6



## felix12345 (Apr 5, 2010)

Hello:

I run the set instruction:

Set datagrid1.datasource = recordset

where i define the recordset previously with a select statement and open the 
recordset, but 
when i run the program, i cannot edit the datagrid. The data 
shows on the datagrid, but when i press a row with the mouse on 
the datagrid, the data dissappears.

How can i set the datagrid for editing.

I hope somebody can help me.

Regards,

david


----------



## felix12345 (Apr 5, 2010)

I found out what was wrong.

I was closing the recordset and closing the connection right after the SET instruction.

Since the SET instruction seems to be interactive, one cannot execute the close instructions after it, 
because the data in the datagrid gets lost.


----------

