Hi,
I have used a Flex Grid control in displaying a set of records from the MS ACCESS database (back end) with the means of VB6 code (front end).
In my database i have 9 records and the flex grid control has been deisgned at design time with 7 rows.
I have full- compiled my code and seen that NO syntax errors exist.
ISSUE:
At runtime, when the grid control retrieves the 9 records from the db, an error is popped up: "Invalid Row Value".
I have tested and seen that if there are 7 records in db, then no errors occur. But, at runtime, if the records queried, exceed the no of rows in the grid control, designed at design time, then this error occurs. And even no vertical scrollbar appears.
----------------------------------------------------------------------
Visual Basic 6 code:
----------------------------------------------------------------------
''''For loop counters for each cell. ex: (0,0) -> (ROW, COL)
Dim dblRow_ISBN As Double, dblCol_ISBN As Double
'''''coding for the DATAGRID control to populate itself with records
'--------------------------------------------------------------
-------------------------------------------------------------
Call Connect_Database ''''database connection code
recset.Open "select ISBN, [Book Title], Author, CoAuthor1, CoAuthor2 " _
& "from " & strTable & " " _
& "order by " & field & ""
'-------------------------------------------------------------------
If (recset.RecordCount <> 0) Then
For dblRow_ISBN = 1 To recset.RecordCount
dblCol_ISBN = 0
grdISBN.Row = dblRow_ISBN 'ROW will be same for all the 5 columns
grdISBN.Col = dblCol_ISBN
grdISBN.Text = recset.Fields("ISBN")
grdISBN.Col = dblCol_ISBN + 1
grdISBN.Text = recset.Fields("Book Title")
grdISBN.Col = dblCol_ISBN + 2
grdISBN.Text = recset.Fields("Author")
grdISBN.Col = dblCol_ISBN + 3
grdISBN.Text = recset.Fields("CoAuthor1")
grdISBN.Col = dblCol_ISBN + 4
grdISBN.Text = recset.Fields("CoAuthor2")
recset.MoveNext
Next dblRow_ISBN
End If
dbconn.Close 'closes database connection
====================================================
Who can really help me on this ? His help will be definately appreciated.
Awaiting reply....