473,440 Members | 1,926 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,440 software developers and data experts.

Windows NT Integrated Security

11
I use "Use Windows NT integrated security" option in .adp to connect to the SQL database. I like to get the user's network login id, who is running the app, to fill a column in a record. Any help is appreciated.
Aug 27 '07 #1
2 1403
MMcCarthy
14,534 Expert Mod 8TB
I use "Use Windows NT integrated security" option in .adp to connect to the SQL database. I like to get the user's network login id, who is running the app, to fill a column in a record. Any help is appreciated.
I've moved your question from the articles section to the forum.

Check out this tutorial

Function to return Username of current user
Aug 27 '07 #2
ADezii
8,834 Expert 8TB
I use "Use Windows NT integrated security" option in .adp to connect to the SQL database. I like to get the user's network login id, who is running the app, to fill a column in a record. Any help is appreciated.
A little API call should be able to retrieve the Current User's Network Log-On ID:
  1. Declare the API Function in a Standard Code Module:
    Expand|Select|Wrap|Line Numbers
    1. Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
  2. Call it in an appropriate manner:
    Expand|Select|Wrap|Line Numbers
    1. Dim lpBuff As String * 25, ret As Long, UserName As String
    2.  
    3. ret = GetUserName(lpBuff, 25)
    4. UserName = Left(lpBuff, InStr(lpBuff, Chr(0)) - 1)
    5. MsgBox "The currently Logged On User is '" & UserName & "'"
Aug 27 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Jeremy | last post by:
In my ASP.NET web applications I would like to use "integrated security=SSPI" instead of supplying a SQL Server account credentials. From what I understand there are security policy settings...
1
by: Greg Busby | last post by:
I have a client who wants to use Windows Integrated Security for authentication and authorization to use this application. They also want this application to run as soon as Windows comes up. So, I...
2
by: epaetz | last post by:
I'm getting Not associated with a trusted SQL Server connection errors on a .Net windows service I wrote, when it's running on my application server. It's not a problem with mixed mode...
2
by: Joseph Geretz | last post by:
I'm having a credentialing problem in my web application. Actually, I don't think this is an IIS security issue, since I'm able to access the page I'm requesting. However, the executing page itself...
4
by: Andrew | last post by:
Hey all, I would like to preface my question by stating I am still learning ASP.net and while I am confident in the basics and foundation, the more advanced stuff is still a challenge. Ok....
5
by: sid | last post by:
I am trying to connect to SQL serevr using 'Windows only Authentication'. Below is my code. Dim strConn As String = _ "data source=localhost; " & _ "initial catalog=northwind; " & _ "integrated...
1
by: Razvan | last post by:
This problem occurs in ASP.Net application, only on Windows 2000. Everything works fine on Windows Server 2003. Here is the scenario: I configured the application to use impersonation and...
7
by: Alice Wong | last post by:
I am setting up my Web ASP.net application to connect to Sql server using windows authentication. I set up IIS to have integrated windows authenication and sql to allow Windows authentication....
2
by: Dariusz Tomon | last post by:
I got an ASPNET C# project from client. When I'm trying to open it in Visual Studio I get error message: "Unable to start debugging on the web server. Debugging failed because integrated Windows...
1
by: Jacob | last post by:
I have some .NET web services deployed in IIS and having the Directory security set to integrated windows security. I would like to call these services form other web based applications written in...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.