Solved

AS400 ODBC Connection password not saving

Posted on 2010-11-18
11
2,301 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Popular third-party chat platforms like Slack, Discord, and Telegram are just a few of the many new productivity applications that are being hijacked by cybercriminals to create command-and-control (C&C) communications infrastructures for their malw…
Article by: Justin
In light of the WannaCry ransomware attack that affected millions of Windows machines, you might wonder if your Mac needs protecting. Yes, it does and here is how to do it.
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

726 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