Using VFP 9.2 on Windows 2000 or XP workstations. Back end is MS SQL 2000.

Some users are on the same domain as the server and so I allow them access
with "trusted_user=yes" in the connection string.

Others are outside our domain and not in a trusted domain (or any domain)
and so I intend to set up SQL Server users and prompt them for userid and
password.

I'd like to do this with one startup program if possible and so I'm looking
for something that will return the domain name. Something on the order of
sys(0) which returns the machine name and userid.

Any thoughts?

Thanks.

Dave Tiffany

Re: Domain Name of user by Gene

Gene
Thu Dec 13 10:33:31 PST 2007

"David Tiffany" <dtiffany@nospam.com> wrote:

>Using VFP 9.2 on Windows 2000 or XP workstations. Back end is MS SQL 2000.
>
>Some users are on the same domain as the server and so I allow them access
>with "trusted_user=yes" in the connection string.
>
>Others are outside our domain and not in a trusted domain (or any domain)
>and so I intend to set up SQL Server users and prompt them for userid and
>password.
>
>I'd like to do this with one startup program if possible and so I'm looking
>for something that will return the domain name. Something on the order of
>sys(0) which returns the machine name and userid.
>
>Any thoughts?

A security risk?

Sincerely,

Gene Wirchenko;trusted_user=yes

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.

Re: Domain Name of user by David

David
Thu Dec 13 10:42:08 PST 2007

Gene,

Not sure what you mean. I'd like to use Windows security for people on my
domain and SQL's security for people outside my domain. The trouble is, how
do I know which someone is when they start the program.

Dave

"Gene Wirchenko" <genew@ocis.net> wrote in message
news:kmu2m35q9eko7dot5on919crhekeuvbi1b@4ax.com...
> "David Tiffany" <dtiffany@nospam.com> wrote:
>
>>Using VFP 9.2 on Windows 2000 or XP workstations. Back end is MS SQL 2000.
>>
>>Some users are on the same domain as the server and so I allow them access
>>with "trusted_user=yes" in the connection string.
>>
>>Others are outside our domain and not in a trusted domain (or any domain)
>>and so I intend to set up SQL Server users and prompt them for userid and
>>password.
>>
>>I'd like to do this with one startup program if possible and so I'm
>>looking
>>for something that will return the domain name. Something on the order of
>>sys(0) which returns the machine name and userid.
>>
>>Any thoughts?
>
> A security risk?
>
> Sincerely,
>
> Gene Wirchenko;trusted_user=yes
>
> Computerese Irregular Verb Conjugation:
> I have preferences.
> You have biases.
> He/She has prejudices.



Re: Domain Name of user by Dan

Dan
Thu Dec 13 10:47:38 PST 2007

GetEnv("userdomain")

Dan

David Tiffany wrote:
> Using VFP 9.2 on Windows 2000 or XP workstations. Back end is MS SQL
> 2000.
> Some users are on the same domain as the server and so I allow them
> access with "trusted_user=yes" in the connection string.
>
> Others are outside our domain and not in a trusted domain (or any
> domain) and so I intend to set up SQL Server users and prompt them
> for userid and password.
>
> I'd like to do this with one startup program if possible and so I'm
> looking for something that will return the domain name. Something on
> the order of sys(0) which returns the machine name and userid.
>
> Any thoughts?
>
> Thanks.
>
> Dave Tiffany



Re: Domain Name of user by David

David
Thu Dec 13 10:58:57 PST 2007

Thanks Dan. That's what I was looking for.

Sorry I couldn't find it in help.


"Dan Freeman" <spam@microsoft.com> wrote in message
news:%232lAjibPIHA.5988@TK2MSFTNGP02.phx.gbl...
> GetEnv("userdomain")
>
> Dan
>
> David Tiffany wrote:
>> Using VFP 9.2 on Windows 2000 or XP workstations. Back end is MS SQL
>> 2000.
>> Some users are on the same domain as the server and so I allow them
>> access with "trusted_user=yes" in the connection string.
>>
>> Others are outside our domain and not in a trusted domain (or any
>> domain) and so I intend to set up SQL Server users and prompt them
>> for userid and password.
>>
>> I'd like to do this with one startup program if possible and so I'm
>> looking for something that will return the domain name. Something on
>> the order of sys(0) which returns the machine name and userid.
>>
>> Any thoughts?
>>
>> Thanks.
>>
>> Dave Tiffany
>
>



Re: Domain Name of user by Dan

Dan
Thu Dec 13 11:27:01 PST 2007

Well, you wouldn't find it in help. Help doesn't document Windows'
environment strings, just a way to retrieve them. <s>

Dan

David Tiffany wrote:
> Thanks Dan. That's what I was looking for.
>
> Sorry I couldn't find it in help.
>
>
> "Dan Freeman" <spam@microsoft.com> wrote in message
> news:%232lAjibPIHA.5988@TK2MSFTNGP02.phx.gbl...
>> GetEnv("userdomain")
>>
>> Dan
>>
>> David Tiffany wrote:
>>> Using VFP 9.2 on Windows 2000 or XP workstations. Back end is MS SQL
>>> 2000.
>>> Some users are on the same domain as the server and so I allow them
>>> access with "trusted_user=yes" in the connection string.
>>>
>>> Others are outside our domain and not in a trusted domain (or any
>>> domain) and so I intend to set up SQL Server users and prompt them
>>> for userid and password.
>>>
>>> I'd like to do this with one startup program if possible and so I'm
>>> looking for something that will return the domain name. Something
>>> on the order of sys(0) which returns the machine name and userid.
>>>
>>> Any thoughts?
>>>
>>> Thanks.
>>>
>>> Dave Tiffany



Re: Domain Name of user by Gene

Gene
Thu Dec 13 13:09:35 PST 2007

[reordered to chronological]

"David Tiffany" <dtiffany@nospam.com> wrote:

>"Gene Wirchenko" <genew@ocis.net> wrote in message
>news:kmu2m35q9eko7dot5on919crhekeuvbi1b@4ax.com...
>> "David Tiffany" <dtiffany@nospam.com> wrote:

[snip]

>>>Any thoughts?
>>
>> A security risk?

>Not sure what you mean. I'd like to use Windows security for people on my
>domain and SQL's security for people outside my domain. The trouble is, how
>do I know which someone is when they start the program.

How do you prevent just anyone from having "trusted_user=yes" in
a connection string?

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.

Re: Domain Name of user by Krister

Krister
Mon Dec 17 00:28:11 PST 2007

Here's a few getenv() strings:

? getenv('appdata')
? getenv('allusersprofile')
? getenv('commonprogramfiles')
? getenv('computername')
? getenv('comspec')
? getenv('homedrive')
? getenv('homepath')
? getenv('localappdata')
? getenv('logonserver')
? getenv('number_of_processors')
? getenv('os')
? getenv('path')
? getenv('pathext')
? getenv('processor_identifier')
? getenv('processor_level')
? getenv('processor_revision')
? getenv('programdata')
? getenv('programfiles')
? getenv('prompt')
? getenv('public')
? getenv('sessionnnme')
? getenv('systemroot')
? getenv('temp')
? getenv('tmp')
? getenv('userdomain')
? getenv('username')
? getenv('userprofile')
? getenv('vs80comntools')
? getenv('windir')

Re: Domain Name of user by David

David
Mon Dec 17 14:19:10 CST 2007

Gene,

Sorry to be so long getting back to the group on this.

As I understand this, in order for a trusted user to work their Windows id
(or a group that they're a member of) has to be specified as a user in SQL.
Only those users would get anywhere claiming to be a trusted user. Am I
missing something?

Dave

"Gene Wirchenko" <genew@ocis.net> wrote in message
news:5p73m3973sjoah7cq1ld0m7r2qhgv1gfb8@4ax.com...
> [reordered to chronological]
>
> "David Tiffany" <dtiffany@nospam.com> wrote:
>
>>"Gene Wirchenko" <genew@ocis.net> wrote in message
>>news:kmu2m35q9eko7dot5on919crhekeuvbi1b@4ax.com...
>>> "David Tiffany" <dtiffany@nospam.com> wrote:
>
> [snip]
>
>>>>Any thoughts?
>>>
>>> A security risk?
>
>>Not sure what you mean. I'd like to use Windows security for people on my
>>domain and SQL's security for people outside my domain. The trouble is,
>>how
>>do I know which someone is when they start the program.
>
> How do you prevent just anyone from having "trusted_user=yes" in
> a connection string?
>
> Sincerely,
>
> Gene Wirchenko
>
> Computerese Irregular Verb Conjugation:
> I have preferences.
> You have biases.
> He/She has prejudices.



Re: Domain Name of user by Gene

Gene
Mon Dec 17 21:32:15 CST 2007

"David Tiffany" <dtiffany@nospam.com> wrote:

>Sorry to be so long getting back to the group on this.
>
>As I understand this, in order for a trusted user to work their Windows id
>(or a group that they're a member of) has to be specified as a user in SQL.
>Only those users would get anywhere claiming to be a trusted user. Am I
>missing something?

I do not know. I was simply raising the possibility. There have
been Websites where such things appeared in URLs. Some nefarious
sorts have done Google searches to find such things.

[snipped previous]

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.