Datagrid help
Posted: Thu Nov 11, 2010 9:37 pm
I have began a little testing and using the code below this creates a query and returns the results to tData. I have
the result showing up in a multi line text box but want the results to be formatted in a datagrid. Can anyone
explain how I could go about doing that?
on mouseUp
-- check the global connection ID to make sure we have a database connection
global gConnectionID
if gConnectionID is not a number then
answer error "Please connect to the database first."
exit to top
end if
-- construct the SQL (this selects all the data from the specified table)
put the text of field "tBrand" into boo
put "[EVEREST_SOLESU].[dbo].[ITEMS]" into tTableName -- set this to the name of a table in your database
put "SELECT * FROM " & tTableName & " where brand = '" & boo & "'" into tSQL
-- query the database
put revDataFromQuery(tab, cr, gConnectionID, tSQL) into tData
-- check the result and display the data or an error message
if item 1 of tData = "revdberr" then
answer error "There was a problem querying the database:" & cr & tData
else
put tData into field "Data"
end if
end mouseUp
the result showing up in a multi line text box but want the results to be formatted in a datagrid. Can anyone
explain how I could go about doing that?
on mouseUp
-- check the global connection ID to make sure we have a database connection
global gConnectionID
if gConnectionID is not a number then
answer error "Please connect to the database first."
exit to top
end if
-- construct the SQL (this selects all the data from the specified table)
put the text of field "tBrand" into boo
put "[EVEREST_SOLESU].[dbo].[ITEMS]" into tTableName -- set this to the name of a table in your database
put "SELECT * FROM " & tTableName & " where brand = '" & boo & "'" into tSQL
-- query the database
put revDataFromQuery(tab, cr, gConnectionID, tSQL) into tData
-- check the result and display the data or an error message
if item 1 of tData = "revdberr" then
answer error "There was a problem querying the database:" & cr & tData
else
put tData into field "Data"
end if
end mouseUp