While searching for info on how to fill a table field with data from a MySQL query I stumbled upon a post by Jan Schenkel from almost three years ago
refering to undocumented calls like:
revReadCellValue(tLongID,tColumn,tRow,tFormat)
revWriteCellValue tLongID,tColumn,tRow,tValue)
revUpdateDatabase tLongID,tColumn,tRow,tValue)
Is this the best info out there or has some real documentation been created?
TIA
Kai
Loading a table field with data
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Hi Kai,
Although these functions may work fine, I would recommend sticking to the fully supported and documented methods as we could change the semantics of any undocumented functions.
If you need to display data from a database table in a Revolution field, I would suggest taking a look at the revDataFromQuery function, which can provide formatted data suitable for putting straight into a field.
For example, lets say you have a table called "users" with the following description:
- id integer primary key
- firstname text
- lastname text
- approved boolean
Once you have connected to your database, you can retrieve the data from the table using a query like this:
If your field is a table field, all you need to do is ensure that the data is formatted with each record on a new line and each column separated by a tab character.
You can easily manipulate the contents of the table field by using the item and line keywords and delimiters.
Hope this is some help.
Regards
Oliver
Although these functions may work fine, I would recommend sticking to the fully supported and documented methods as we could change the semantics of any undocumented functions.
If you need to display data from a database table in a Revolution field, I would suggest taking a look at the revDataFromQuery function, which can provide formatted data suitable for putting straight into a field.
For example, lets say you have a table called "users" with the following description:
- id integer primary key
- firstname text
- lastname text
- approved boolean
Once you have connected to your database, you can retrieve the data from the table using a query like this:
Code: Select all
local tUserData
put revDataFromQuery(tab, return, sgDatabaseId, "SELECT id, firstname, lastname, approved FROM users") into tUserData
if item 1 of tUserData is "revdberr" then
-- Handle error here
end if
put tUserData into field "Users" of me
You can easily manipulate the contents of the table field by using the item and line keywords and delimiters.
Hope this is some help.
Regards
Oliver
Oliver Kenyon
Software Developer
Runtime Revolution
Software Developer
Runtime Revolution