suhas-mahajan
12th February 2003, 08:46
Dear All,

For updating my site, I have to copy .MDB file to my ftp area daily, I have to connect to ftp area and I am manually copying it, I want to make it automatic, How to resolve this problem? Is there any way in BaaN?

Waiting for immediate reply.

-Suhas

OmeLuuk
12th February 2003, 13:24
There is no way in Baan to do this,
there is a Multi Level Download Tool that creates an ftp-script that automates a lot of these things.

You can modify a copy of $BSE/lib/ftpbaan to perform your task and schedule it via the crontab (at on Windows).

norwim
12th February 2003, 23:48
Hi there!

On M$ Systems it is very easy to automate ftp sessions:
if you have a file called EXAMPLE.XXX with the content:
-----------------
open 123.123.123.123
user
password
cd /somewhere
lcd d:\DIR
prompt
bin
mget *.mdb
bye
-----------------
you can call ftp with a parameter to execute all these ftp commands (something like ftp \s:EXAMPLE.XXX, but I am not 100% sure about the syntax)

You can write a .bat file and start that with AT or
call this bat-file from a baan program using shell command.

hth

Norbert

suhas-mahajan
21st February 2003, 07:03
Dear norwim / OmeLuuk,

I think you are very near to my solution, here I am giving more details so that things will clear to me. See, daily at night we are updating our site which is MS-Access based. There were big issue, how to send data to MDB file. Daily night we are taking sequential backup. We made a program in VB which will convert this .S files into text and text into MDB, because our database side is not that much strong and we don't want to select ODBC/Net8 way. But some times in the nights we couldn't take sequential backup because of night shifts, month-end back-logs, etc. result no site updation. To overcome this problem, I am making one session where I used seq.open for making text files, in VB I made a program which send text files to tables of .MDB now the last part is remained that is how to copy this .MDB file to ftp area. see the form:
c:\windows\desktop\pcobd.bmp

Hope this will help you for finding solution for me.

-Suhas

MATT12
2nd April 2003, 11:58
Hi to all,


In our company which is connected through network, I developed an internal Website link to baan. I'm currently using Windows NT for my PC and to our baan server we are using Unix. I link all important Database through ODBC. for all queries regarding baan we all use the site we called Portal. we only have only 21 baan licensed and more than 200 baan user in our company it is much reliable and useful to us. maybe it will help you guys.

Thank You.

suhas-mahajan
4th April 2003, 11:36
Dear Matt,
My aim is, just to copy MDB file to ftp area through schedular. :)
because it is not possible for me to change entire architecture of my site connecting with ODBC.
If you have any idea, please let me know.
Norwin is very near to my solution, but what is m$ system, I couldn't get.

-Suhas

benito
4th April 2003, 18:46
Hi suhas,

That was what norwim was saying. Create a .bat file that includes your ftp and schedule it with "at" command.

That should solve your problem.

victor_cleto
5th April 2003, 17:24
This thread has been moved to operating systems since is OS related.

norwim
7th April 2003, 11:32
M$ = Microsoft,

sorry

countnikon
18th April 2006, 18:50
What I have done is I have a shell script that does the FTP connection and a baan session that calls this script and uploads the data. Then on the web server, I use PHP to import the data to mysql. Here is an example of my baan code:


function run.upload()
{
long j
long i
domain tcmcs.s100 input.filename
domain tcmcs.s100 input.filename2
domain tcmcs.s100 input.filename3
long templong
templong = run.prog("/baan/parts/import.orders","",RP_WAIT)
| Clear Previous Load
message("Clearing any Previous Uploaded Data from tdsls994..")
clear.tdsls994()
message("Clearing any Previous Uploaded Data from tdsls995..")
clear.tdsls995()
message("Clearing any Previous Uploaded Data from tdsls996..")
clear.tdsls996()

for i=6 to 19
for j=0 to 6
if i<10 then
input.filename="/baan/parts/orders_"&date$&"_0"&str$(i)&"0"&str$(j)&".txt"
input.filename2="/baan/parts/orderlines_"&date$&"_0"&str$(i)&"0"&str$(j)&".txt"
input.filename3="/baan/parts/address_"&date$&"_0"&str$(i)&"0"&str$(j)&".txt"
else
input.filename="/baan/parts/orders_"&date$&"_"&str$(i)&"0"&str$(j)&".txt"
input.filename2="/baan/parts/orderlines_"&date$&"_"&str$(i)&"0"&str$(j)&".txt"
input.filename3="/baan/parts/address_"&date$&"_"&str$(i)&"0"&str$(j)&".txt"
endif
| Load File
if upload.tdsls994(input.filename) then
|message(input.filename)
shell("mv "&input.filename&" "&input.filename&".loaded",0)
endif
if upload.tdsls995(input.filename2) then
shell("mv "&input.filename2&" "&input.filename2&".loaded",0)
endif
if upload.tdsls996(input.filename3) then
shell("mv "&input.filename3&" "&input.filename3&".loaded",0)
endif
endfor
endfor
create.tccom013()
create.tdsls040()
templong = run.prog("/baan/parts/output.orders","",RP_WAIT)
}


And then here is an example of my shell script

# /usr/local/bin/baan.csiparts
# script to upload data from baan to CSI Online Parts Ordering System
ip_address=***.***.***.***
ip_user=***
ip_pass=***

ftp_mode=binary
logfile="/usr/local/var/partslog.log"
ftpworked=n

#run ftp command
echo "getting inventbycwar.txt"
ftp -n -v $ip_address <<-EOFtp >$logfile 2>&1
user $ip_user $ip_pass
$ftp_mode
prompt off
#ftp commands
lcd /baan/parts
put "inventbycwar.txt"
put "ariel_parts.txt"
put "customers.txt"
put "address.txt"
bye
EOFtp
rm /baan/parts/inventbycwar.txt
rm /baan/parts/ariel_parts.txt
rm /baan/parts/customers.txt
rm /baan/parts/address.txt

bdittmar
18th April 2006, 19:47
Dear Matt,
My aim is, just to copy MDB file to ftp area through schedular. :)
because it is not possible for me to change entire architecture of my site connecting with ODBC.
If you have any idea, please let me know.
Norwin is very near to my solution, but what is m$ system, I couldn't get.

-Suhas


Hello Suhas,
Norwim means MS-System (Microsoft System).
He's an UX Fan, like me.
On UX you can use "rcp" command (Dont't know, if this command is available on MS-Systems).

With this command i copy a lot of files to our MS based CRM System every night.

Write the TXT-Files -> convert with ux2dos and rcp it to target system.

Regards

I checked MS, RCP (remote copy) is available on W2K-Systems.

Syntax : RCP [-a|-b] [-h] [-r] [HOST][.USER:]SOURCE [HOST][.USER:]PATH\TARGET

-a = ASCII-Mode
-b = Binary-Mode
-h = transfer hidden files
-r = copy subdirs (rekursive)

The remote shell daemon RSHD has to run on target system (W2k3 Server).