Datagrid refresh and display refreshed data
Hi,
Please help me!
I have VB 6.0 application which is used to extract lock information of a job if any of the user locks it. There is a possibility of a job getting locked in different ways. So when i click on get locks info, its displays the lock info of job in datagrid as below
Job No | Job Type | Job Pid |Job user
123 | A | 222 | Tom
123 | A | 333 | Kat
I am able to pull the above data successfully andnow my question is my application should allow user to select the required row and unlock it, after the unlock is successful, it should remove the row that was selected and display the refreshed datagrid.
Please help me.
thanks,
M
Re: Datagrid refresh and display refreshed data
Thread moved from the 'CodeBank VB6' forum (which is for you to post working code examples, not questions) to the 'VB6 and earlier' forum
Re: Datagrid refresh and display refreshed data
Hi Mahesh,
Assuming Your problem,
1)First find display all the data available from a table on data grid
Code:
Private Sub Form_Load()
With grdAccount ' name of the grid
.ColWidth(0) = 100
.ColWidth(1) = 100
.ColWidth(2) = 100
.ColWidth(3) = 100
End With
Call grd_Data_Loader
End Sub
'Code for grd_data_Loader
Private Function grd_Data_Loader()
rs.Open "Select*from tblAccount", cn, 3, 3
Set grdAccount.DataSource = rs
Set rs = Nothing
End Function
2) Select the row for which u want to unlock
3) on select of the row call this function delete which will remove an entry from table
4) Call the grd_Data_Loader function again