maxbel
6th December 2001, 15:25
I am developing a script which exports table structure into chm format for useing with sourcecode editing.
All go well, but i am not able to programmatically access to tools texts: Help for tables, fields, domains. How can i retrieve it?
tootsie
9th December 2001, 01:30
Hello Maxbel,
As far as i know you have be root to use the company 000 tables in reports or queries. The tables are outside the baan-directories so normal users (on os-level) can't get to them.
If you want to use them for a report or querie in the life company, what you can do is to copy the tables of company 000 to a new company number within the baan-directorie and register them as new democompany as part of the life Baan environement.
Hope it helps you.
victor_cleto
9th December 2001, 11:49
Originally posted by tootsie
As far as i know you have be root to use the company 000 tables in reports or queries. The tables are outside the baan-directories so normal users (on os-level) can't get to them.
I don't agree with this tootsie, you shoud never use root except when strictly needed. The owner of all directories/files (except a few ones, like inside bin and audit) associated with Baan are owned by bsp and, at least, readable by group bsp.
How and with wich user you are trying to access the data?
tootsie
9th December 2001, 13:49
Hello Victor_Cleto
Thank you, I fully agree with you. My message can be interpreted as if the user must become root, this is not the case.
Wat I mean is to copy the tables to a new company in your own package combination, you don't have to become root for that.
Then you can acces the data in the new tables and use it in your own reports.
Maybe there are other ways? You probably have to update the tables regulary to get the most recent information.
maxbel
13th December 2001, 15:33
This is example, which works
|
|@created
| by Max Belugin 08.11.2001 16:24:32
function extern tab.forFields(){
forFields.h=sql.parse("SELECT * FROM ttadv422 WHERE ttadv422._compnr = 0 and "&
"cmbd={:ttadv420.cpac, :ttadv420.cmod, :ttadv420.flno, :ttadv420.vers, :ttadv420.rele, :ttadv420.cust}"
)
sql.exec(forFields.h)
}
but this do not work
|
|@created
| MaxBelugin 10/11/00 16:22:07
function extern void htc.forLines(){
forLines.isEmpty=ttadv160.txtn=0
if not forLines.isEmpty then
forLines.h=sql.parse(
"select text:1, seqe from tttxt003 where "&
"_compnr = 0 and "&
"cmcc={"&str$(ttadv160.txtn)&
",'"&language$&"'} order by seqe"
)
sql.select.bind(forLines.h, 1, forLines.cur)
sql.exec(forLines.h)
forLines.fHasNext=sql.fetch(forLines.h)=0
endif
}
the problem is, that i can not read only tttxt003, but can other tools table.
gfasbender
13th December 2001, 20:20
Maxbel,
You need to use the function text.to.buf() to get text from Baan's text tables.
#include <bic_text>
string forLines(MAX_LINE_LEN, MAX_LINE_COUNT)
long forLinesCnt
function extern void htc.forLines()
{
| Once you determine the help text code number (ttadv160.txtn)
| You can get the help text from company 000 using text.to.buf()
long t.compnr, rc
forLines.isEmpty=ttadv160.txtn
if not forLines.isEmpty then
t.compnr = get.compnr()
| User must have permission for company 0!
rc = switch.to.company(0)
forLinesCnt = text.to.buf("ttadv160.txtn",
language$,
MAX_LINE_COUNT,
forLines)
| forLines(,) text array contains the text!
switch.to.company(t.compnr)
endif
}