Solved

AS400 ODBC Connection password not saving

Posted on 2010-11-18
11
2,013 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
Comment Utility
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 34

Assisted Solution

by:Gary Patterson
Gary Patterson earned 250 total points
Comment Utility
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 34

Expert Comment

by:Gary Patterson
Comment Utility
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
 

Author Comment

by:SCMHC
Comment Utility
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
Comment Utility
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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 34

Expert Comment

by:Gary Patterson
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now