Dropped a datagrid (called dg1) on a new stack and card with the basic DB connection code working nicely.
Although the debugger shows the dbCursor and dbDgArray to both be fully populated with the table's contents after the following code is run, the dg1 data grid just sits on the card unmodified, laughing at me!

There are four rows of data in the DB table, and there are four "editable" rows in the data grid, but no data is displayed.
Obviously there is some display mechanism I'm missing, but my reviews of the doc and forum have led me here. Clues anyone?
adTHANKSvance!
Code: Select all
## Query the database for data
put "my_table" into tDbTableName
put revQueryDatabase( gConID, "SELECT * FROM " & tDbTableName & ";") into dbCursor
if dbCursor is an integer then
#DEBUG answer info "Cursor is integer " & dbCursor
ConvertSQLCursorToArray dbCursor, dbDgArray
put the result into dbError
if dbError is empty then
## The cursor was successfully converted to an array.
## Assign it to the data grid.
lock screen
set the dgData of group "dg1" to dbDgArray
unlock screen
end if
## Close the database cursor
revCloseCursor dbCursor
end if