vineetu1
20th December 2005, 07:43
Is it possible to access another database from Baan ?? Suppose we have created some custom application on VB and database in SQL server and would like to access that database, how can it be done ?? The tables in the database are not created from Baan.

The other issue is how can we insert the records in tables created from Baan. Basically how to generate the data for hash colums. Is there any standard algorithm for it ?

csecgn
20th December 2005, 14:07
Is it possible to access another database from Baan ??
We don't use it, but it is. Take a look at ttaad4110m000 and ttaad4111m000.

Suppose we have created some custom application on VB and database in SQL server and would like to access that database, how can it be done ?? The tables in the database are not created from Baan.

I've never tried it completely, but I think it could work this way:

Create the table on SQL Server
Create the new Database in ttaad4110m000
Create the table definition only
Assign the tables to the database (ttaad4111m000)
Convert your tables to Runtime DD without recofigure
Copy the DD.new files to the correct DD files
Remove the corresponding records in the ttaad50x tables (Company 000) manually
We use this way (without the first steps) if our tables are too large for changing them regular.
We are on Oracle/Unix with Level 2 driver, but it also should work with SQL/Windows 2000.

Just seen:

To your second qestion and if you are on Level 1 and have to/want to migrate to Level 2 this thread could be helpfull :

http://www.baanboard.com/baanboard/showthread.php?t=24446

Maybe this helps

Regards
csecgn

george7a
21st December 2005, 14:45
Is it possible to access another database from Baan ??

You can make a VB exe that will run and get the data you want and store it on the server. Then make a Baan script that will execute the exe & read the stored data.

I hope it helps,

- George

vahdani
21st December 2005, 16:08
Hi,

no need to write your own exe! I've just recently used SQLServer's own command line tool "bcp.exe" in a project. You can specify the query to run as a parameter. Use the "queryout" mode. You need to have a good working knowledge ttbwdll programming though.. :rolleyes:

Therfore as always.....

vineetu1
27th November 2006, 11:22
Hi Vahdani, could u explain this little more. (If possible could u give an example).

vahdani
27th November 2006, 12:22
Hi vineetu1,

following is a small extract of a larger program to print item documents onhand information stored in SQLServer. In the table field "tccom890.bcpp" is the full pathname to the bcp.exe

........
result.file = "${TEMP}\documents.txt"

query = sprintf$("SELECT IDENT, CREATE_DATE, FILE_NAME, " &
" FILE_EXT, SUB_FOLDER " &
"FROM %s " &
"WHERE IDENT='%s'", table.name, tccomdll8900.ident)

command = strip$(tccom890.bcpp) & " "
& chr$(34) & query & chr$(34) & " "
& "queryout " & result.file & " "
& " -S " & strip$(tccom890.srvr) & " -c -t | "

if tccom890.trst = tcyesno.yes then
command = command & " -T "
else
command = command
& " -U " & strip$(tccom890.user)
& " -P " & strip$(tccom890.pwrd)
endif

|delete any previous results
remove.local.file(result.file)

app_id = app_start( command, "${TEMP}", "", "", "")

|wait for termination!
terminated = false
suspend(1000)
if app_status(app_id) then
while not terminated and next.event(event)
on case evt.type(event)
case EVTTERMINATION:
if evt.termination.object(event) = app_id then
terminated = true
endif
break
endcase
endwhile
endif

|check if result file exists

if seq.fstat.local( result.file, length ) < 0 then
| no result file!
return(false)
endif
.....


The next step is to copy the query results to the server and interpret this