If Navision is started with a command line “servername= etc etc” then the server name is available to C/SIDE Via the COMMANDLINE call. How can I derive the servername if Navision is started with “File” - “Server” - Connect. I need to be able to pass the servername to an external VB program which is launched via a SHELL command from within Navision

Good question, i took a look at some of the virtual tables provided in Navision, and it doesn’t seem to be possible to retrieve this information. Anyone aware of a workaround for this? Soren Nielsen, moderator Integration/Developer NOLUG

Use this way to get the servername. variables - string_value text , post1 integer, pos2 integer ServerName Text. string_val := FORMAT(COMMANDLINE); pos1 := STRPOS(string_val,’=’)+1; pos2 := STRPOS(string_val,’,’)+1; ServerName :=COPYSTR(string_val,pos1,pos2-pos1-1); Regards Joseph Mathew Edited by - joseph_mathew on 2001 Apr 26 15:01:22

Thanks Joseph, but Ross already mentioned this solution and was looking for a solution that will work even if you don’t connect your server via the commandline. So assume you have connected by using database->open (or as it was in earlier versions server->connect). How do you find the servername then? Soren Nielsen, moderator Integration/Developer NOLUG

Why not store the servername in the G/L-setup? I don’t suppose You move You’re database between different servers to often. //Lars