fill field Contents
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
fill field Contents
ciao all,
how can I use the Contents pane, in the property inspector of a Basic Table Field, to insert the data columns of a database respecting the order of it?
for example:
from the Db table_Ident
name. . . . .last_name
Bill. . . . . . . .The Kid
Robert. . . . . .Zimmerman
into the field
1° col. . . . .2° col
bill. . . . . . .The Kid
Robert. . . . .Zimmerman
using the icon folder button of the Contents pane, I tried to open the DB directly, also convert first the Db into a .xls or .txt file. but, obviously, it does not work.
thanks for help
franco
how can I use the Contents pane, in the property inspector of a Basic Table Field, to insert the data columns of a database respecting the order of it?
for example:
from the Db table_Ident
name. . . . .last_name
Bill. . . . . . . .The Kid
Robert. . . . . .Zimmerman
into the field
1° col. . . . .2° col
bill. . . . . . .The Kid
Robert. . . . .Zimmerman
using the icon folder button of the Contents pane, I tried to open the DB directly, also convert first the Db into a .xls or .txt file. but, obviously, it does not work.
thanks for help
franco
Re: fill field Contents
Hi Franco,
the "table field" is just a text field and accepts TAB delimited TEXT (and text files) but you cannot connect to a database here.
So put your data into a TEXT file (TAB delimted!) and you can import it via the "folder" button in the inspector.
Of course you can put the data that you have fetched from a database directly into a "table" field via script!
Best
Klaus
the "table field" is just a text field and accepts TAB delimited TEXT (and text files) but you cannot connect to a database here.
So put your data into a TEXT file (TAB delimted!) and you can import it via the "folder" button in the inspector.
Of course you can put the data that you have fetched from a database directly into a "table" field via script!
Best
Klaus
Re: fill field Contents
ciao Klaus, nice to meet you again.
this trash:
returm me all data into the first column of the field
best
franco
I should like but, I again fight against item delimiterKlaus wrote:...
Of course you can put the data that you have fetched from a database directly into a "table" field via script!
Best
Klaus

this trash:
Code: Select all
put "SELECT distillato,descrizione FROM tbldistillati order by distillato" into tQuery
--This will query the Database Table using the statement in tQuery
put numtochar(1) into tItemDel
put numtochar(2) into tLineDel
put revDataFromQuery(tItemDel, tLineDel, tDatabaseID, tQuery) into tDatapiatti
best
franco
Re: fill field Contents
Franco,
do you remember what the DEFAULT delimiters in database queries are?
We used some time to finally change it to numtochar(1 and 2) to fit your needs!
We did this because your database fields contained MULTILINE text.
If you now use a field (instead of a datagrid) you will have the SAME problems with MULTILINE text!
If not, well what is the logical conclusion to this fact? Hint, see my first sentence!
Best
Klaus
do you remember what the DEFAULT delimiters in database queries are?
We used some time to finally change it to numtochar(1 and 2) to fit your needs!
We did this because your database fields contained MULTILINE text.
If you now use a field (instead of a datagrid) you will have the SAME problems with MULTILINE text!
If not, well what is the logical conclusion to this fact? Hint, see my first sentence!
Best
Klaus
Re: fill field Contents
TAB and CRKlaus wrote:Franco,
do you remember what the DEFAULT delimiters in database queries are?
...
do you mean to use default delimiter? no dai!Klaus wrote:...
If you now use a field (instead of a datagrid) you will have the SAME problems with MULTILINE text!
If not, well what is the logical conclusion to this fact? Hint, see my first sentence!
...
it works only with records without multi line text. I don't like make only copy-and-paste, without know that I'm doing. at present I'm so far....
ciao
franco
Re: fill field Contents
But you now need to decide what to do!
1. So your data HAS multiline text, right?
2. TAB and CR does not work if this is the case.
3. numtochar(1/2) does also not work for a TABLE field. which is ONE field and not a lot of grouped objects like a datagrid
Can't you also use a datagrid here?
If you really need to use a TABLE field then this is possbile, but needs a lot of preparation to make the data fit!
1. So your data HAS multiline text, right?
2. TAB and CR does not work if this is the case.
3. numtochar(1/2) does also not work for a TABLE field. which is ONE field and not a lot of grouped objects like a datagrid
Can't you also use a datagrid here?
If you really need to use a TABLE field then this is possbile, but needs a lot of preparation to make the data fit!
Re: fill field Contents
1 yesKlaus wrote:But you now need to decide what to do!
1. So your data HAS multiline text, right?
2. TAB and CR does not work if this is the case.
3. numtochar(1/2) does also not work for a TABLE field. which is ONE field and not a lot of grouped objects like a datagrid
...
2 yes
3 yes: good, this is another new information for me.
I've never used DataGrid object, not even in the other occurrence, where you explain to me the use of numtochar(1/2), I put data into a list field.Klaus wrote:...
Can't you also use a datagrid here?
If you really need to use a TABLE field then this is possbile, but needs a lot of preparation to make the data fit!
I can show what I've, the code below comes from an old version of the project I want to implement (and is not mine...)
Code: Select all
on mouseUp
local tDatabaseID
put revOpenDatabase("ODBC", "esa", "esa", "abcd", "1234" ) into tDatabaseID
put "SELECT distillato,descrizione FROM tbldistillati order by distillato" into tQuery
--This will query the Database Table using the statement in tQuery
put revDataFromQuery(tab, cr, tDatabaseID, tQuery) into tDatapiatti
--This will display all the data from the Database
put tDatapiatti into field "elenco_argomenti_risposta"
--This closes the Database connection
revCloseDatabase tDatabaseID
end mouseUp
this is what I want to do.
could fit even a Data Grid, if it is easier to use
ciao
franco
Re: fill field Contents
You might try using revQueryDatabase instead of revDataFromQuery. It returns a cursor id instead of the actual data. You can then navigate thru the records using revMoveToxxxRecord (xxx=First/Next/Prev/Last) and revDatabaseColumnNamed to get the data from a column into a variable.
You still have to deal with return and tab characters in the data of course. I usually do that by replacing them with a string of some sort. Or you can replace return with numToChar(11) to handle return characters.
Pete
You still have to deal with return and tab characters in the data of course. I usually do that by replacing them with a string of some sort. Or you can replace return with numToChar(11) to handle return characters.
Pete
Re: fill field Contents
tanks Pete for your suggestion.
I've solved, finally, changing the delimiters. here put the recordset from the query into a Table Field:
and below show data, divided by elements, into different text fields and labels
ciao all
franco
I've solved, finally, changing the delimiters. here put the recordset from the query into a Table Field:
Code: Select all
put revDataFromQuery("§","|", tDatabaseID, tQuery) into tDistillati
replace cr with " " in tDistillati
replace tab with " " in tDistillati
replace "§" with tab in tDistillati
replace "|" with cr in tDistillati
---------------------This will display all the data from the Database
put tDistillati into field "elenco_argomenti_risposta"
and below show data, divided by elements, into different text fields and labels
Code: Select all
command visualizza_risposta
put fld "elenco_argomenti_risposta" into tTempList
filter tTempList with the text of the field"txtcerca_argomento" & "*"
set itemdel to tab
--put tTempList into fld "txtdescrizione"
put item 2 of tTempList into fld "txtdescrizione"
put item 3 of tTempList into fld "lblOrigine"
end visualizza_risposta
franco