Solved

AS400 ODBC Connection password not saving

Posted on 2010-11-18
11
2,168 Views
Last Modified: 2012-05-10
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
Comment
Question by:SCMHC
  • 5
  • 3
  • 3
11 Comments
 
LVL 6

Assisted Solution

by:Jon Snyderman
Jon Snyderman earned 250 total points
ID: 34172322
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
 
LVL 35

Assisted Solution

by:Gary Patterson
Gary Patterson earned 250 total points
ID: 34172761
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
 
LVL 35

Expert Comment

by:Gary Patterson
ID: 34172777
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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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.

 

Author Comment

by:SCMHC
ID: 34172785
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
 
LVL 6

Expert Comment

by:Jon Snyderman
ID: 34173518
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
 
LVL 35

Expert Comment

by:Gary Patterson
ID: 34173690
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
 

Author Comment

by:SCMHC
ID: 34175864
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
 
LVL 6

Expert Comment

by:Jon Snyderman
ID: 34175934
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
 

Author Comment

by:SCMHC
ID: 34177155
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
 

Accepted Solution

by:
SCMHC earned 0 total points
ID: 34191822
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
 

Author Closing Comment

by:SCMHC
ID: 34221287
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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article describes my battle tested process for setting up delegation. I use this process anywhere that I need to setup delegation. In the article I will show how it applies to Active Directory
This article describes how to reset your Windows 10 password when you've forgotten it.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question