I am using MSHFlexgrid in VB 6.0 code and while adding data
to the grid i am getting the error "Invalid Row Value" run time
error no "30009". will anybody help me out !
for add data, what code u use. plz post ur code.
Check the value assigned to mshflexgrid1.row at the time of error, it should not be greater than (one less than mshflexgrid1.rows) and should be valid integer/long.
While adding, you need to check if the Grid has got that many rows... say if the grid has 3 rows and you are trying to fill data in fourth row, then you will get error..
Grd.Rows = Grd.Rows+1
if you are using sql statements to fill your datagrid
you may use the following
Set adorsRAM = cn.Execute(sSQL) If Not adorsRAM.EOF Then Set msh.DataSource = adorsRAM msh.FormatString = "DATA No." For i = 1 To (msh.Rows - 1) msh.TextMatrix(i, 0) = i Next i msh.Refresh Else msh.Clear msh.FixedCols = 1 msh.FixedRows = 1 msh.Rows = 2 msh.Cols = 2 msh.FormatString = "DATA No." MsgBox "No Records Found in DataGrid!"
here cn is the connection
ssql is the sql statement
adorsram is the adodb.recordset
you can try it