I have an application working on web that access AS/400, If the server is restarted I get the logon window, we create this app as web app so we don’t need to install odbc on every computer…
Here is my code
Uselsx “*LSXODBC”
Dim Con As ODBCConnection
Dim Qry As ODBCQuery
Dim Result As ODBCResultSet
Dim DNS As String
Dim User As String
Dim Password As String
Dim Query As String
DNS = DocConfig.MyDNSField(0)
User = DocConfig.MyUserField(0)
Password = DocConfig.MyPwdField(0)
Set Con = New ODBCConnection
Set Qry = New ODBCQuery
Set Result = New ODBCResultSet
Set Qry.Connection = Con
Set Result.Query = Qry
Con.SilentMode = True
Call Con.ConnectTo ( DNS, User, Password )
Query = “SELECT * FROM TTRAB”
Qry.SQL = Query
If Result.Execute Then
Some stuff
end if
Con.Disconnect
When the code run I get the logon window…
Any Idea how can I avoid this logon window ? I have values on User and Password but just don’t take then
I assume this code is in an Agent and you run the agent with a URL and the login you are getting is Domino’s HTTP login prompt?
Then checkmark “Allow public access users to view and run this agent” in the agent properties. In the ACL of the database that contains the agent, add an entry for Anonymous and make sure that “Read public documents” is selected for Anonymous.
If the login prompt is displaying on the servers screen, then it’s being caused by the ODBC DSN. When connecting to an AS400 I recommend using the iSeries Access ODBC driver, and make certain that the username and password specified in the connection.connectto is correct and that the user profile is enabled on the as400.
The iSeries Access web page is here if it helps. But it sounds like you need to find out what release the AS/400 is at first and go from there. Your AS/400 Admin should (hopefully) be able to provide you with the iSeries Access installation CD or perhaps point you to a directory on the AS/400 itself where the installation files are located.
I belive Client Access was renamed to iSeries access when upgrading from V5R1 to V5R2, so it’s essentially the same, but Like Dallas said - make certain you have the correct version.
I can’t remember if it’s needed when you go in with iSeries Access drivers, but you might also need to set up a db directory entry on the iSeries side (wrkrdbdire). Just a thought.
It seems like I’ve seen this behavior before when the DSN is defined as a user DSN instead of a system DSN. You may also just need to make some tweaks to the “Connection Options” of the “General” tab of the iSeries Access ODBC data source. Look at how it’s configured now and keep notes of what you change until you get it to work.