Hi Robert,
Yes, I found a solution. In case more people are interested, I'm CC'ing this
reply to MapInfo-L as a sum on the subject.
The Novell Netware user name is stored in an environment variable named
NWUSERNAME, which can be fetched by utilizing a WinAPI call.
' The WinAPI call declaration
Declare Function GetEnvironmentVariable Lib "kernel32" Alias
"GetEnvironmentVariableA"
(ByVal lpName As String,
lpBuffer As String, nSize As Integer
) As Integer
' A small routine to encapsulate the messy call
Function NovellUserName() As String
DIM x AS INTEGER
DIM UserStr AS STRING
DIM lpBuffer AS STRING
DIM BuffSize AS INTEGER
BuffSize=1024
lpBuffer=string$(1024,chr$(32))
x = GetEnvironmentVariable("NWUSERNAME", lpBuffer, BuffSize)
NovellUserName = RTrim$(lpBuffer)
End Function
Thanks to Peter M�ller for supplying me with the API declaration so I
needn't go look for it :-)
Best regards / Med venlig hilsen
Lars V. Nielsen
--------------------------------------------------------
Hvenegaard & Meklenborg
Rugaardsvej 55, DK-5000 Odense C
Denmark
http://www.hvm.dk
----- Original Message -----
From: "Brough, Robert" <[EMAIL PROTECTED]>
To: "Lars V. Nielsen" <[EMAIL PROTECTED]>
Sent: Tuesday, March 02, 2004 10:12 AM
Subject: RE: MI-L Retrieving Novell network user name in MapBasic ?
> goddag Lars,
>
> I read your post with interest but never noticed any replies to it. Did
> you find a solution in the end? I have experienced the same problem and
> would be interested to know of any solutions.
>
>
> Regards,
>
>
> Robert Brough
> The National Trust for Places of Historic Interest or Natural Beauty
> East Midlands Regional Office
> Clumber Park
> Worksop
> Notts
> United Kingdom
>
> -----Original Message-----
> From: Lars V. Nielsen [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 10, 2004 3:14 PM
> To: MapInfo-L
> Subject: MI-L Retrieving Novell network user name in MapBasic ?
>
>
> Hi,
>
> I've previously succesfully used the WinAPI function GetUserName to
> retrieve the Windows/network logon user's name.
>
> Now I've been given the task to retrieve a network name from Novell, in
> which case the above schema cannot be used since all users log into
> their PC as "Administrator" !!!
>
> Has anyone tangled with Novell in this respect and succeeded ? All hints
> and ideas are helpful :-)
>
> TIA
>
> Best regards / Med venlig hilsen
> Lars V. Nielsen
> --------------------------------------------------------
> Hvenegaard & Meklenborg
> Rugaardsvej 55, DK-5000 Odense C
> Denmark
> http://www.hvm.dk
>
> ________________________________________________________________________
> This email has been scanned for all viruses by the MessageLabs Email
> Security System. For more information on a proactive email security
> service working around the clock, around the globe, visit
> http://www.messagelabs.com
> ________________________________________________________________________
> ********************************************************
> One tonne of recycled paper (= 100 bin bags) saves 17 trees, 17000
> gallons of water and enough energy to heat the average home for 6 months
> - RECYCLE MORE -
> **********************************************************
>
> confidentiality :-
> The National Trust believes in treating information with
> care. Because this message and any attachments may
> contain information which is confidential, if you have
> received it in error please contact us immediately and
> do not disclose, copy, use or store it in any way.
>
> viruses :-
> It is our policy to check emails for viruses before
> sending, but we recommend that you also check the
> message and any attachments, as either could contain
> viruses which could damage your systems.
>
> charity details :-
> The National Trust for Places of Historic Interest or
> Natural Beauty. 36 Queen Anne's Gate London SWIH 9AS
>
> Registered Charity Number 205846
> Tel: +44 (0)20 7222 9251
> Fax: +44 (0)20 7222 5097
> www.nationaltrust.org.uk
> ********************************************************
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________
>
>
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 10663