Hi Trevor,
What do you see in the message box if you add this to the handler:
Code: Select all
## print out MD array with first line of each key value.
put printkeys(theRegionDataA)
I put the code at the end of the button, is correct?
Salut,
Josep
Moderators: FourthWorld, heatherlaine, Klaus, robinmiller, trevordevore
Code: Select all
## print out MD array with first line of each key value.
put printkeys(theRegionDataA)
Code: Select all
printKeys(theQueryA)
Code: Select all
dbconn_connect
put the result into theError
if theError is not empty then
answer "error connecting:" && theError
end if
Code: Select all
dbobject_set "storage object", the long id of button "DB Storage"
put the result into theError
--dbconn_delete "desarrollo"
put dbobject_getConnection("desarrollo") into theConnA
if theConnA is not an array then
dbconn_create "desarrollo", "mysql"
put the result into theError
if theError is empty then
dbconn_set "host", "www.xxx.xxx"
dbconn_set "username", "admin"
dbconn_set "password", "xxx"
dbconn_set "database name", "store"
dbconn_set "type","mysql"
end if
end if
dbobject_save
put the result into theError
if theError is empty then
dbconn_connect
put the result into theError
if theError is empty then
answer "Connected! ID " & dbconn_get("connection id")
else
answer "Error connecting:" && theError
end if
Code: Select all
on mouseUp
dbobject_createFromObject the long id of button "DB Storage"
put the result into theError
put sqlquery_create("products") into theQueryA
answer printKeys(theQueryA)
sqlquery_retrieveAsArray theQueryA, theArrayA
put the result into theError
if theError is empty then
## Array can be assigned directly to a data grid
set the dgData of group "dg_test" of me to theArrayA
else
answer "Error populating: " && theError
end if
revspeak "Datagrid loaded"
end mouseUp
Code: Select all
table
name: product
database parameters:
conditions:
type: query reference
cursor id: 0
related table joins:
select clause:
scopes:
group by:
connection: desarrollo
distinct:
condition bindings:
full column names:
column delimiter:
database: default
order by:
row delimiter:
Code: Select all
put dbobject_getArray() into theA
put printkeys(theA)
Code: Select all
put sqlquery_get(theQueryA, "query")
Code: Select all
sqlquery_set theQueryA, "select clause", "field1, field2, field3"
Code: Select all
printkeys(theArrayA)
Excellent!Yes, now is working! "
I have no plans on translating the error messages reported by SQL Yoga as they are not intended to be displayed to the user. They are intended to inform the developer of the error. If you would like to display errors to your users then you should provide your own suitable message with translations.1. I lost the connection with the mySQL and I get a message box with the problem, I click again and the query connect correctly. How can change this message? For example translate to spanish. If you want I can help to translate or revise the translations."
A data grid always requires a column name that matches keys in the internal array. When you set the dgData to an array you are explicitly setting the internal array. When setting the dgText and you don't provide column names then the data grid is creating those column names and internal array keys for you (col 1, col 2, etc.). Using dgData is faster as no translation has to be done. I would recommend setting up your data grids ahead of time with the proper column names and labels and then setting the dgData.2. Using arrays ever the datagrid must have the exactly column names to mach it? Some use like dgText to fill auto the datagrid?"
SQL Yoga does support multiple database objects. All SQL Yoga calls assume you are using the database object named "default" which saves you from having to type "default" in every time you make an API call. Since the sample application uses "default" and your application uses "default" there was a conflict.3. While testing with Yoga, I loaded the sample application. After load it my database object don't work more until I initialize again. Then sample application doesn't work.
How can I do to work with many dbobjects?"
What If I Need to Work With htmlText, rtfText or unicodeText?4. Its posible to convert html tags to wiew as html text in the datagrid and save it as html tags from the datagrid?"
The data grid manual discusses this.