I think I am missing it somewhere with this one.
Up to now I have been doing this the "monkey see monkey do" way.
I do understand the concept of connecting to a remote SQL database and creating a query "The Cursor"
The data is then by default stored in a tabbed delimited array with cr at the end of each line in a data variable.
The datagrid is then populated with the Array data.
Please correct me if I am wrong with any of the above process concepts.
Here is my code
-- Here it connects to a remote MySQL database
-- It notifies the user that the connection is made
-- connecting to the database
on mouseUp
global dbID
put revOpenDatabase(“MySQL","The IP address”,"Database Name”,”User Name","My Password") into dbID
if dbID is not a number then
answer warning "Error "&dbID
exit to top
else
-- notify the user of any errors if any
answer info "You are connected"
end if
end mouseUp
-- The query is executed and the result put into TheData variable
global dbID
set itemdelimiter to tab
-- This is a field on my stack with the query
put fld "sql1" into theQuery
put revDataFromQuery(,,dbID,theQuery) into theData
if theData contains "revdberr" then
answer warning "There is an error "&theData
exit to top
end if
set the dgText [true] of grp "datagrid1" to TheTextData & tData
At the moment the array is stored in a field called theResult on the main stack
Kindly see the attached image.
I do not get any errors but the datagrid does not get populated.
Would really appreciated it if someone could just point out any syntax errors and the process of loading the data into the datagrid.