learner
18th March 2004, 15:05
Hi,
I am using function clienttoserver() to transfer a file from client to server, the file is getting transfered properly if i am running baan from Win XP, but if i am doing it from Win 98 it's not transfering the file.
I get the error -1 when running the same session on win 98.
why that so ???? I read the description of error 1, it says "Not the owner" what's the description for error -1 ???
and secondly, can't i transfer the file to some other server other than baan ???
the below code returned me error -13, which talks of permission. Although i have also made the full hard disk shareable for the other server along with the folder.
long ret_val
ret_val = client2server("C:\myfol\myfile.txt","\\someotherserver\F\destfolder\subfolder", 0)
and third, is there any function in BaaN IV c4 which will give me the client ip address from where he is running baan ?? I know get.bw.hostname() is there, but that is for BaaN 5, any function for BaaN IV c4 ??
Waiting for your reply.
Regards
Learner
lbencic
18th March 2004, 19:16
Hi Learner -
Not sure of all your problems, I have used client2server without problem in the past, I run W2K though.
There are many ways to skin this cat though. Try this post (http://www.baanboard.com/baanboard/showthread.php?s=&threadid=7097&highlight=dllfilehand) on how people have done this with run.prog and issueing OS commands.
Also you can try looking at the library: ttdllfilehand and use those commands. You must include this library when using the functions. It is not a documented library, run a bic_info on the object to see the syntax of the commands.
Here's a post (http://www.baanboard.com/baanboard/showthread.php?s=&threadid=14151&highlight=copy.file) from a while ago that has some further explanation and an example of the copy with different hostname.
As for the IP address, I'm not sure. You can try hostname$, seems to be in the help, but that will probably return the name, not address. May be usable though, it's how it says to reference the other servers in the examples.
learner
18th March 2004, 19:24
Hi,
Thanks, i will go through the links which u have specified.
Regarding hostname$ as far a i remember it returns the name of the baan server and not the client from where we are running BaaN.
Correct me if i am wrong.
Regards
Learner
lbencic
18th March 2004, 19:34
O I'm sorry, I misunderstood. Your right, much easier in Baan V.
You can probably issue the shell commands to get this. The local command 'hostname' will print the name of the PC, and you can capture that and return it to the program.
Is there a command for just the IP address? Not very OS Savvy - but just issue that and capture the results.
NPRao
18th March 2004, 20:02
Is there a command for just the IP address?
Refer to the other postings -
Client type (http://www.baanboard.com/baanboard/showthread.php?s=&threadid=1705&highlight=client)
Since you are on the Windows OS, you can use the same concept and issue the DOS command -
C:\>nbtstat -n
Local Area Connection:
Node IpAddress: [10.50.74.3] Scope Id: []
NetBIOS Local Name Table
Name Type Status
--------------------------------------------
MBN273282 <00> UNIQUE Registered
MBN273282 <20> UNIQUE Registered
CFI <00> GROUP Registered
CFI <1E> GROUP Registered
C:\>
or you can also use the command - ipconfig
C:\>ipconfig
Windows IP Configuration
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . : ABC.com
IP Address. . . . . . . . . . . . : 10.50.74.3
Subnet Mask . . . . . . . . . . . : 255.255.248.0
Default Gateway . . . . . . . . . : 10.50.72.1
C:\>
You can capture this output and then the parse to get the IP.
j. streun
22nd March 2004, 21:21
I was having similar problems with the client2server a few months ago - running W2K and Baan 50C. Below is a description of what was happening when I tried to specify the file name to be used by client2server. There are several other posts related to this that have other suggestions as well. Hopefully, some of it will help.
Good Luck!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bdittmar -
Thank you for your response. I was able to get the app_start function to work but I wasn't able to work with the data.
However, I did eventually find a solution - here's what I found: First of all, Baan doesn't seem to like file names like "ABC New File.txt" . Replace or remove any spaces in the filename. Same goes for directory names. I also found that where the file was located made a difference. For example, if the file was in the:
c:\Documents\BaanV\Sales_Invoices directory, client2server returned an error
If I moved the file up 2 levels - to the: c:\Documents directory (or to the root directory), client2server did NOT return an error and copied the file.
The final thing is that you cannot assign the file/pathname to a variable and use this variable for the source name - as soon as you assign "c:\Documents" to a variable you get the double backslash. However, if you place the file/pathname in quotes within the client2server function, this substitution doesn't happen.
ret.val = client2server("c:\Documents\ABC_New_File.txt", destination.file.name, false, false)