Login SQL Server Linked Tables Automatic On Event Load Of Login Form
Apr 17, 2015
I have a ms access application in Front End and linked tables to sql server 2008 r2 in back end.. every time I open my application the linked tables ask to me for the user and password of the sql server user of the odbc conection. I want to connect to my sql database without login every time the user open the application, I know that can be possible if I start session from vba code...
I have access 2010, I currently have a database in place and operational. What I am wondering is there a way to have a form come up whenever someone opens access and asks for a password and login name. Also I would like to have a 2 tier system. One for Admins and the other for users with limited access.
We have two back end SQL Server databases accessed by VPN to a remote location using RDP locally. It is common to use MS Access as a report generation tool oftentimes containing linked tables from either or both db's and having Reports/Forms/Queries utilizing joins against tables from both SQL databases. Having to enter User Name and Password twice each time is more than a pain.
First a user would not have access to the MS Access report FE without first having appropriate and successful login UN/PWD to the remote server. Therefore having to login again when instancing reports/forms/queries against those linked tables/pass through queries is a minor pain. How or what process is used to tell Access to never prompt for User Name and Password? Or is there one? Kind of like telling MS Query tool in Excel to 'Remember Password'...
I have a MS Access project that uses a SQL Server connection to retrieve data. It is set up to authenticate the user every time the database is used, which is what I want it to to.
The problem is the timing of the dialog. In 'design mode', Access tries to show the Database window as soon as the file is loaded, realizes that it has to fetch data from the SQL connection, and prompts the user for the password - this is fine. However, the 'release version' has a different setup. Automatic showing of the database window is disabled, and the user controls the app via a customized menu instead. The result is that Access only prompts the user for his SQL Server credentials when a form is opened - this isn't OK. I would like Access to always ask for a SQL logon when the file is opened, even in 'release' mode.
I'm kinda new to using Access and SQL Server together, but I suppose there is some way of programatically invoking the dialog via a macro, right ? If so, what function should I use, and how do I make a macro that is run immediately after opening the file ?
It would also be nice if there was some way of detecting a successful logon, so that it can reinvoke the dialog indefinitely if logon fails.
Not sure if this is possible but I have in my db a linked ODBC connection to a table. I use a Oracle 8 login to access the linked table. My question is can I capture the user login in ID somewhere in my table to show who is logged in? Thanks...
I linked a table (front to back) yesterday. I had a user enter information into this table. It's a login table. The login screen of the asp page is not able to find the record, even though I can see it in both tables. I am not sure what's wrong, since both tables show the same information. Does anybody have any ideas?
Dear all, I have an application includes one table "info" and two forms "frmlogin" & "frmwelcome". The table "info" contains many columns, two of them are [UserName] and [PassWord]. This table is filled with three records. "frmlogin" form contains two text boxes and one button. I want the user to enter user name and the password in those two text boxes, and when clicking the button, I want the application if that user is registered or no. If yes, he/she will be moved to the "frmwelcom", that display "Welcome [UserName]".
I need help with my Video rental store project the problem is that I want a security login method works with the my requirements. The manager has his own form with all the information he need and the other employees has another form.
I used this tutorial http://www.databasedev.co.uk/login.html to make the login form
the employee tables has ID, Password, Access Level
The VB code is like this
Option Compare Database Private intLogonAttempts As Integer Private Sub Form_Open(Cancel As Integer) 'On open set focus to combo box Me.cboEmployeeLogOn.SetFocus End Sub
Private Sub cboEmployeeLogOn_AfterUpdate() 'After selecting user name set focus to password field Me.txtPassword.SetFocus End Sub
Private Sub btnLogin_Click()
'Check to see if data is entered into the UserName combo box
If IsNull(Me.cboEmployeeLogOn) Or Me.cboEmployeeLogOn = "" Then MsgBox "You must enter a User Name.", vbOKOnly, "Required Data" Me.cboEmployeeLogOn.SetFocus Exit Sub End If
'Check to see if data is entered into the password box
If IsNull(Me.txtPassword) Or Me.txtPassword = "" Then MsgBox "You must enter a Password.", vbOKOnly, "Required Data" Me.txtPassword.SetFocus Exit Sub End If
'Check value of password in tblEmployees to see if this 'matches value chosen in combo box
If Me.txtPassword.Value = DLookup("EmployeePassword", "tblEmployee", "[EmployeeID]=" & Me.cboEmployeeLogOn.Value) Then
MsgBox "Password Invalid. Please Try Again", vbOKOnly, "Invalid Entry!" Me.txtPassword.SetFocus End If
'If User Enters incorrect password 3 times database will shutdown
intLogonAttempts = intLogonAttempts + 1 If intLogonAttempts > 3 Then MsgBox "You do not have access to this database.Please contact admin.", vbCritical, "Restricted Access!" Application.Quit End If
End Sub
I am asking for two things. First I want the Manger go to his form after the login completed and all the other employees go to another form I specify.
Second if there is a way that I show the name of the Employee in the destination form by knowing his ID (passing the ID to the other form).
I have built a login form which shows or hides all tool bars depending on the user name and password. Can I also control the other permissons like being able to edit forms and tables? I know I can do this using the MS Access built in functionality, but can I do it programatically from my user login screen.
I set the tool bar visibility, close the login form and open the main switchboard using the "on click" button of my login form. Can the above permissions controls be done here as well?
I'm currently having issues with my login script on my opening form... it's supposed to close the application if it gets 3 failed attempts, but it's not closing... it just keeps giving me a popup and letting me type the password again. Here's the Code:
'Check to see if data is entered into the UserName combo box
If IsNull(Me.cboEmployee) Or Me.cboEmployee = "" Then MsgBox "You must enter a User Name.", vbOKOnly, "Required Data" Me.cboEmployee.SetFocus Exit Sub End If
'Check to see if data is entered into the password box
If IsNull(Me.txtPassword) Or Me.txtPassword = "" Then MsgBox "You must enter a Password.", vbOKOnly, "Required Data" Me.txtPassword.SetFocus Exit Sub End If
'Check value of password in tblEmployees to see if this 'matches value chosen in combo box
If Me.txtPassword.Value = DLookup("Password", "tblLogin", "[UserID]=" & Me.cboEmployee.Value) Then
Else MsgBox "Password Invalid. Please Try Again", vbOKOnly, "Invalid Entry!" Me.txtPassword.SetFocus End If
'If User Enters incorrect password 3 times database will shutdown
intLogonAttempts = intLogonAttempts + 1 If intLogonAttempts > 3 Then MsgBox "You do not have access to this database. Please contact admin.", vbCritical, "Restricted Access!" Application.Quit End If
I have a login form which works fine, but I would like it so that when the caret is in the password field that if the user presses Enter it will do the loginBtn_Click event. This is what I've tried so far...
Private Sub txtPassword_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbkeyEnter Then kecode = 0 loginBtn_Click End If End Sub
i am having a login form. where i have only two users..may be 3 suppose it is admin and guest then i have a main form where i have 5 tabs,...where each tab contains 7 or more command buttons which will open some forms what i need is when the admin is login he should be able to edit add delete but if it is a guest then all the forms should be read only i know abt the allowaddition and etc..but i don't know where to use it.. is it in the login form or in the main form or in each and every form
Im not that expert in access programming, still have some more learning to do. anyway, my goal is to make a simple login form with a database of its users. How do I code it. The structure of my form is it has 2 unbound txtbox and 1 command button. A user will input its username and password then when the command button is clicked it will validate the user table if the data encoded is in the database. Thanks hope u can help me.
i have a login form in access , i want to set the value for the textbox , for example i want to set "Username" appear in the textbox when in click in the textbox clear the textbox like the title in the web it is possible !!
I am trying to create a multi user login form for my Access 2010 database. I will have 2 different types of users (administrator and staff). The administrator will be able to see all tables and forms and edit/ add to them. The staff will only be able to view a switchboard form and 2 forms (as well as using combo boxes to look up specific records). However, I don't want the staff to be able to view the tables or edit anything.
I am trying to set up a login form in my DB. I have followed the instructions from some of the previous posts on this site.
I have a table called tblUsers with 'UserId', 'UserName' and 'Password' as the fields. I also have two text boxes 'txtUserName', 'txtPassword' and a 'cmdLogin' command button on my form with the following code:
Private Sub cmdLogin_Click()
If IsNull(Me.txtUserName) Or Me.txtUserName = "" Then MsgBox "You must enter a User Name.", vbOKOnly, "Required Data" Me.txtUserName.SetFocus Exit Sub End If
'Check to see if data is entered into the password box If IsNull(Me.txtPassword) Or Me.txtPassword = "" Then MsgBox "You must enter a Password.", vbOKOnly, "Required Data" Me.txtPassword.SetFocus Exit Sub End If
If Me.txtPassword.Value = DLookup("Password", "tblUsers", "[UserID]=" & Me.txtUserName.Value) Then
Else MsgBox "Password Invalid. Please Try Again", vbOKOnly, "Invalid Entry!" Me.txtPassword.SetFocus End If End Sub
Unfortunately, this code is not working in my database (MS Access 2000). I think the error occurs on the line on which it checks the password against the stored password (If Me.txtPassword.Value = DLookup("Password", "tblUsers", "[UserID]=" & Me.txtUserName.Value) Then).
I get a Run-Time error'2471' message saying "The expression you entered as a query parameter produced this error: 'The object doesn't contain the Automation object for 'smith." NB 'Smith' is the user name entered into the login form 'txtUserName' box.
Any idea why this may occur? I would be very grateful if you could let me know please.
Thanks alot for your time. And keep up the good work guys! :)
i've completed the whole access DB, but now i need to implement the login form, so each user can access their data + admin access.
what is the simples/fastes way to do this, since i've got working db. I add fields (user-log-id and password)to "userTable" and now i just need simple veryfication to login and logout.
I have a table called 'Klanten' which contains the rows 'password' and 'login' (and several rows not needed for this form)
So I'm trying to make a login form which first checks if something is entered (this part of the code seems to work).
Private Sub Knop13_Click() 'Check to see if data is entered into Username If IsNull(Me.Username) Or Me.Username = "" Then MsgBox "gelieve een login in te voeren.", vbOKOnly, "Required Data" Me.Username.SetFocus
[Code] ....
But from then on i seem to have some issues.. The part of the code underneath seems to only work for the first 'login' and 'paswoord' in my table called "Klanten".
-Username is the name for the field where they enter their 'login'. -Password is the name for the field where they enter their 'paswoord'
If Username.Value <> DLookup("[login]", "Klanten", "[Username]='" & Username & "'") Then MsgBox "Invalid Username. Please try again.", vbOKOnly, "Invalid Entry!" Exit Sub End If
If Password.Value <> DLookup("[wachtwoord]", "Klanten", "[Password]='" & Password & "'") Then MsgBox "Invalid Password. Please try again.", vbOKOnly, "Invalid Entry!" Exit Sub End If
Then as last part i would like to goto another form called 'Mainmenu' if both the Login and the Paswoord is correctly entered in the fields Username and Password. Here i have the most issues as this doesn't seem to do anything at the moment
If Password.Value = DLookup("[wachtwoord]", "Klanten", "[Username]='" & Username & "'") And Username.Value <> DLookup("[login]", "Klanten", "[Password]='" & Password & "'") Then DoCmd.OpenForm "Mainmenu" End Sub
I have a fully functioning frmLogin that appears when the database opens. After correctly logging in, it takes you to the appropriate switchboard. The problem is that I set autokeys to allow F1 to automatically open the switchboard, but I don't want users to hit this to bypass my login screen. The reason for keeping the switchboard open is to force the user to close the database using the switchboard(eventually I want to limit the user to only the forms that I have created in a split database).
My other option that I tried first was writing a module that would detect when all forms are closed, then open the switchboard. But I kept getting Error91 and got frustrated/stopped attempting this method. Using the hotkey gives the user a similar functionality, but less conveniently so(since its not an automated process, etc.).
I have a table called "tblEmployees" with columns "EmpName, EmpPassword, strAccess" in my table
The login form works but I wanted the user to go to a specific form that would be designated under strAccess
I have this code but it totally wrong to what I want it to do but not sure where to start
'Close logon form and open relevent page Dim stDocName As String stDocName = Forms!CopyfrmLogon!cboEmployee.Column(3) DoCmd.OpenForm stDocName
[Code] ....
"stDocName = Forms!CopyfrmLogon!cboEmployee.Column(3)" - this is the line that needs to be debugged ... I need something that says open form specified in the the column "strAccess" of the "tblEmployee" tables
I am doing a login form for my database using online references and videos.
Below is the code for my login form.
Private Sub Form_Load() Dim Security As Integer Me.txtUser = Environ("USERNAME") If IsNull(DLookup("UserSecurity", "Userslist_table", "[UserLogin]='" & Me.txtUser & "'")) Then MsgBox "No Usersecurity set up for this user. please contact the Admin", vbOKOnly, "Login info"
[Code] ....
End Subi am facing problem for run-time error type mismatch '13': i have listed below field names which is used in above coding.
UserSecurity_table [SecurityID] is Autonumber field [SecurityLevel] is Text field
Userlist_table [UserID] is autonumber field [Username] is text field [Userlogin] is text field [Usersecurity] is text field [Password] is text field
I have been searching for info with users & permission levels. I have ready a lot about ULS (User Level Security) which doesnt seem to be my answer as I do not have admin rights and I believe it is not suitable with Access 2010.
Basically I have an 2010 Access database which is used by my department as a project management tool. It has various tables, forms, queries & reports, I have created a table with user names & passwords and a login form. So when the databases opens the login form is launched & the users selects their user name & enters their password, then the main menu is shown.
Everything works really well, but as the moment there is no difference between all the users. All I want to do is to be able to make one of the Logins read only, ie if the Reviewer is logged in they can see & read every form and run every report but they can not make any edits.