I have a user who is unable to log into my Access database when the environ("username") function is added to the DB. The database resides on OneDrive because we need to share a single copy.
There is a module that stores the username function, having the code below:
Option Explicit
Option Compare Database
Private Declare PtrSafe Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Public Function UserName() As String
Dim cn As String
Dim ls As Long
Dim res As Long
cn = String(1024, 0)
ls = 1024
res = GetUserName(cn, ls)
If res <> 0 Then
UserName = Mid(cn, 1, InStr(cn, Chr(0)) - 1)
Else
UserName = ""
End If
End Function
There is a login form through which the username() value is written to a log table.
I am able to log in to the database when it is on OneDrive, but my user cannot. When he double-clicks it, he is unable to even click the 'enable content' button. It is just frozen and he has to close access completely.
When I check the log table I can see my login activity with my username, so I know the environment variable is working for me. My goal is to be able to use the environment variable to identify the current user, store login and store record update activities.
Thank you for any assistance,
LJ
Microsoft warns against opening Access databases on shared document libraries. This includes Sharepoint and OneDrive, even in cases where an Access front-end on a client machine is accessing a split database stored in the document library. They warn that, "multiple copies of the database may get created and some unexpected behaviors may occur." They don't specify what behaviors, but I can guess data corruption for one.
I recommend installing and configuring a VPN server that supports the L2TP and IPsec protocols, and sharing the back-end (tables only) of the split database in a securely configured public directory. L2TP and IPsec could resolve the authentication issued you described. Point the Access clients to back-end tables in that directory. It will appear as a shared folder on the LAN.
An alternative is to share the database from a cloud platform, like JumpCloud (very affordable), Azure, AWS, Google Cloud, VMWare Cloud, or OpenVPN.
Related
I am in a problem is that I am accessing my report server from a website, but as I have embedded the report on the website I do not want to show the authentication prompt, but I know that the anonymous authentication in SSRS 2016, I would like know how I can solve this.
I mean window authentication, when you try to remotely access the Report Server, it shows you the window prompt, when I have that report embedded in my website, it will do the same to ask me for the window password, and I will I want to connect anonymously, but sql server 2016 does not allow anonymous authenticationenter image description here
enter image description here
For whoever else is fashionably late: you can implement a custom authentication for anonymous access, as mentioned in the documentation:
The report server will not accept unauthenticated requests from an anonymous user, except for those deployments that include a custom authentication extension.
There is a good example by James Wu for SSRS 2008, which I got working for 2017. However, as he said:
why would you want everyone on the internet to be able to view/update/overwrite your stuff on the report server?
DO NOT USE ANONYMOUS AUTH!
NEVER USE IT IN PRODUCTION ENVIRONMENT!
Emphasize: all (anonymous) users can then also update the settings. (You may be able to prevent this by not providing binding (or only a machine-binding) for /Reports. I am not an expert on this.)
If you still want to use it, just make sure that you adapt all the config-settings correctly, and update IAuthenticationExtension to IAuthenticationExtension2 with an extra method:
public void GetUserInfo(IRSRequestContext requestContext, out IIdentity userIdentity, out IntPtr userId)
{
userIdentity = new GenericIdentity("Dummy user");
userId = IntPtr.Zero;
}
For compilation I also had to include C:\Program Files\Microsoft SQL Server Reporting Services\SSRS\ReportServer\bin\Microsoft.ReportingServices.Interfaces.dll (there does not seem to be an official Nuget).
I'm creating a system the provides users with access to a database where each user has an account with a password. For security reasons, I'd like to ensure that their password is not the same as the one they use to log in to Windows (server 2008 R2 with Windows 7 clients). I don't want to know every user's system password, rather just that the password they're trying to set is not identical to it.
Essentially, I'd like to be able to write a function that I can call it like so:
If IsSystemPassword(txtPass.Text) = False Then
'hash password and save it to database
Else
'return error and ask for new password
End If
Is this possible? Thanks in advance.
I need a little guidance on what I can do with an FTP site I am creating.
Essentially the FTP is to provide data that end users have requested. Workflow is as follow:
User selects what data they want -> User's info (contact, requested data/formats, custom user and password string) stored in SQL table -> Email sent to FTP manager with unique ID of end user -> FTP Manager runs script using unique ID as input, generating the requested data -> Data stored in directory on FTP server and email sent to end user with credentials for obtaining data.
So far, everything up to the credentials part of my workflow is working. The FTP uses no authentication as of right now (because I'm not sure what needs to be done to do so).
My question is, is it possible for me to create IIS users to access the FTP site using the user/password string I create when the end user makes the request, that way I can use some authorization on the FTP site? Am I even approaching this in the correct manner? I'm no IIS/DB guru but I know enough to break something.
What I think I should do:
Set the authentication to use IISManagerAuth, and with magic create the IIS users based off of the credentials I create from the end user request (This is what I am going to try and do while you smart folk point and laugh at my lack of understanding and blindness of the inevitable).
Any guidance appreciated!
I am building a suite of apps that rely on each other's data.
I wanted to put this shared data repository in the Documents library folder.
However, when I attempt to submit the app to the Windows 8 store, I am denied access to that folder location.
I have a developer account which does not qualify for DocumentLibrary access.
I was told that because I am not a company, I do not qualify for a company account.
How can I share application data with my other apps when offline?
Yes, one of the differences between company/individual accounts is access to the Document Library (full list of differences here).
If offline is a requirement, one option is SQLLite. See Tim's post on it here.
If online is sufficient, Windows Azure Mobile Services is pretty awesome for throwing up a quick and easy database backend. More details here.
Windows Store apps run in a sandboxed environment, isolated from each other, therefore they can't easily share their data.
If having a custom online service that both apps can connect to for sharing data between them is not enough, then you'll need the user to select a folder (from both apps) where the shared data will be stored. This way you'll be able to access it.
First use FolderPicker for the user to select the folder:
var picker = new FolderPicker();
picker.FileTypeFilter.Add(".sqldb");
var folder = await picker.PickSingleFolderAsync();
Then add the folder to FutureAccessList so that you'll keep the access to it even after the app gets restarted:
var token = StorageApplicationPermissions.FutureAccessList.Add(folder);
You need to store the token so that you can load it next time. LocalSettings would be a suitable location. When your app is run again, you first read the token and with it regain access to the selected folder:
var folder = await StorageApplicationPermissions.FutureAccessList.GetFolderAsync(token);
I know this is not a perfect solution since it needs user intervention to setup everything correctly, but I think it's the only way to make such data sharing between apps possible. Even so, you might have a hard time certifying the app with this functionality.
we have offshore contractors that are tryingt o run an app that performs the following Active Directory call, shown below in VB.NET
Dim objRootDSE As New DirectoryEntry("LDAP://RootDSE")
Return "GC://" & Replace(Replace(objRootDSE.Properties("rootDomainNamingContext").Value().ToString, ",", "."), "DC=", "") 'DC=uis,DC=unisys,DC=com
The code returns an error on the function return line, indicating that it could not contact the server, which, when it works for me locally, is "DC=uis,DC=unisys,DC=com "
The contractors connect to our company's internal network via VPN and in general have access to the full network, so I don't know why they shouldn't be able to contact this server.
Other offshore users in other locations have no problem with the same code.
I know almost nothing about AD. Can someone give me a clue?
The code works for you because you're running it on a computer joined to your domain (uis.unisys.com) and you're logged in as a user in that domain. When you access the DirectoryEntry on line two you do that in the context of the user executing the program. Because the consultants don't use/have accounts in your domain they won't have access.
Simplified explanation: You'll find it difficult to get the code above to work on any computer that isn't domain-joined to your network (because finding the RootDSE relies on that). The purpose of your code is to get the domain name and do a Global Catalog (GC) search. You'll most likely find that there's other code further down in your program which won't work on systems not connected to your domain.
I would suggest this instead:
Dim objRootDSE As New DirectoryEntry("GC://uis.unisys.com", "username", "password")
Where the username and password matches an service account in your domain. That way the consultants can connect to your domain under the context of that user and perform the work required.