Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2657
  • Last Modified:

AS400 ODBC Connection password not saving

Hi,
I have Access databases that link to tables in the AS400 and SQL.  Most of the users are on a thin client server, and some are on PC's.  My problem is, everytime I run a query against the AS400 table it asks for the password.
I've created SYSTEM DSNs on each server and checked the 'save password' when linking to the table.  When I open the Access database on a different server  I have to enter the password again.  I have no problem with the links to SQL.  
I've read alot of answers on this site about pass-thru queries and some with systems programing, but I'm not understanding where to put the code and which parameters to change.

Appreciate the assist.

0
SCMHC
Asked:
SCMHC
  • 5
  • 3
  • 3
3 Solutions
 
Jon SnydermanCommented:
The password request is controlled on the client PC or Thin Client from within iSeries Navigator (or Operations Navigator depending on the version of the client software).  You can set to integrate with Windows, ask one time per session or ask every time.   I am assuming that it is set to ask every time.

Hope that helps.  

~Jon
0
 
Gary PattersonVP Technology / Senior Consultant Commented:
As I understand it, Microsoft's database engine stores the password locally.  This means that if you open the Access database from a different system, the password isn't available.  You are probably using Windows-integrated authority with SQL server, so it isn't an issue.

It is really best to enter a user ID and password for each connection to the AS/400.  Otherwise you have to hardcode one someplace, and that's not very secure.  That said, if that's not workable for you, there are lots of ways to get around the problem.  Here are a couple of ideas:

One:  Create a BAT file that logs onto the AS/400 using the Client Access CWBLOGON command and then opens the Access database.

@cwblogon.exe AS400.NAME.COM /u AS400USER /p AS400PWD
@start c:\test\test.accdb

Two: Write an autoexec macro in your Access the pre-connects to the AS/400, similar to this MS example:

http://support.microsoft.com/kb/245587

- Gary Patterson
0
 
Gary PattersonVP Technology / Senior Consultant Commented:
Note that "Integrate with Windows" only works if your AS/400 user names and passwords are identical to your AS/400 user names and passwords.
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
SCMHCAuthor Commented:
Hi, thanks for the feedback but I mis stated my problem...iits not on every query that the password is being requested, its when the database is opened the tables need to be refreshed and the password is requested ...
but I will check the Navigator
Deby
0
 
Jon SnydermanCommented:
Hi Deby,

Both, Gary's and my answers, are still approriate.  My solution is more desirable if tracking the user at the connection level is necessary.  Gary's is preferrable if its only about avoiding the prompts.   Both are accurate.

Gary's comment about the windows integrated authentication is correct and we usually dont recommend it for that reason.  But it is an option in the right environment such as single signon.

~Jon
0
 
Gary PattersonVP Technology / Senior Consultant Commented:
If I understand the question correctly, Deby wants to keep users from seeing a logon prompt at all when running a query that runs against a linked table.

As I stated above, it is safer to require users to authenticate.  Caching credentials in a BAT file or in a macro creates all sort of security issues, and password management issues.  I don't particularly like the solution, but it works.

I'd prefer you to set up the ODBC connection to always prompt, from a security standpoint.

- Gary Patterson

0
 
SCMHCAuthor Commented:
Gary/Jon,
I agree that the ODBC connections should use the users credintials, but with the AS400 that seemed impossible, so a generic id and password was created, so when the link to the AS400 tables is created and the box is check  'save password' , then every time I open the database I should be linked to the AS400 tables, same as the SQL tables, without the user needing to enter a password.

I'm not that savy a programmer in understanding the code that is attached to the link (I don't know which parameters to change) and I tried the .bat suggestion but that did not work, but of course, I could have missed something.

I think part of the issue might be, that this is a thin client environment, and having administrator rights, I also have to re-enter the password.
ODBC connections have been created on all servers.

Really appreciate the assist
Deby
0
 
Jon SnydermanCommented:
Tell us more about the thin client.  Is it XPe, Citrix, Terminal Services, etc..?  Are you running the ODBC connection from the thin client or from the server through the thin client?

~Jon
0
 
SCMHCAuthor Commented:
IT guys went home for weekend...but I think its Terminal Services...a user will log on via remotely and be sent to one of 4 available servers...so I guess its from the server through the thin client.
The ODBC connection is on each server either via Manage your Server - Administrative Tools - Data Sources (ODBC)  under the tab System DSN or
from the Start Menu when on that particular server -  Administrative Tools - Data Sources (ODBC)  under the tab System DSN
clicking on the button Connection Options, the User ID is hard coded.  then it asks for the password and I've entered that.
When I link to the AS400 table I also click on the button to 'save password'  but it really doesn't so when a query is run against the table it requests the password or the tables have to be refreshed and the password will be requested then...
Thanks so much for the assist...
Enjoy the weekend.
Regards
Deby
0
 
SCMHCAuthor Commented:
Gary/Jon
Thanks so much for the assist...I got this working using your .BAT solution.  I did not understand the file name to use and I used the wrong one...hence it did not work.  DUH!  LOL
Thanks again and I close this questions giving both you 500 pts...
Happy Thanksgiving...
Deby
0
 
SCMHCAuthor Commented:
not sure how this site worked but giving the credit for the solution to Gary...did not understand what to replace with AS400.Name.Com and it did not work the first time around...just want anyone reading the thread to know that the .BAT is the answer
thx
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now