Results 1 to 7 of 7

Thread: Connection string to use Windows Authentication for iSeries in Visual Basic.net 2010

  1. #1
    New Member
    Join Date
    Aug 12
    Posts
    9

    Connection string to use Windows Authentication for iSeries in Visual Basic.net 2010

    Hello,
    I have created an application in visual basic.net 2010 using iSeries ODBC. Application works fine, but other users from different PC are unable to run the program due to user ID is invalid and password invalid. Error 2800. I am using file DSN below partial snap shot of the App. Config.
    <connectionStrings>
    <add name="SeminarUploadWindowsApplication.My.MySettings.ConnectionStringFileDSN"
    connectionString="Driver={iSeries Access ODBC Driver};system=S10B1163;dftpkglib=QGPL;languageid=ENU;pkg=QGPL/DEFAULT(IBM),2,0,1,0,512;qrystglmt=-1;libview=1;conntype=2"
    providerName="System.Data.Odbc" />
    </connectionStrings>

    The connection string I am using doesn't seems to use Windows Authentication (below)
    Driver={iSeries Access ODBC Driver};system=S10B1163;dftpkglib=QGPL;languageid=ENU;pkg=QGPL/DEFAULT(IBM),2,0,1,0,512;qrystglmt=-1;libview=1;conntype=2

    I have looked at various websites for string connection, but all with specified user ID and password.
    If anybody can give me the proper connection for Windows Authentication from iSeries I would appreciate the help. Thank you.

  2. #2
    Fanatic Member KGComputers's Avatar
    Join Date
    Dec 05
    Location
    www.vbforums.com
    Posts
    550

    Re: Connection string to use Windows Authentication for iSeries in Visual Basic.net 2

    Have you installed iseries odbc drivers on all users? Perhaps you could look into the isearies db user configuration. There might be an issue with that.

    Cheers..

  3. #3
    New Member
    Join Date
    Aug 12
    Posts
    9

    Re: Connection string to use Windows Authentication for iSeries in Visual Basic.net 2

    KGComputers,

    Thanks for your tip. My user have iSeries odbc and works properly, I created Excel programs using odbc and works fine, my VB program works fine in my PC, but the user can't run the program in their PC due to invaild user ID and incorrect password.

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 02
    Posts
    21,653

    Re: Connection string to use Windows Authentication for iSeries in Visual Basic.net 2

    If you're using DSN, then the username & password configuration would be in that DSN configuration... based on your description, it sounds like it's using a coded user/password and you want to use Windows Authentication. Can I assume that the database has the authentication already configured properly? I know nothing about iSeries... so I'm only going by what is in this post... but I wonder if the "conntype=2" parameter in your connection string means anything in this case (like maybe 2 is database authentication and 1 means windows???? ) just a guess.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.-I also subscribe to all threads I participate, so there's no need to pm when there's an update.*
    *Proof positive that searching the forums does work: View Thread *
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *
    * Use Offensive Programming, not Defensive Programming. * On Error Resume Next is error ignoring, not error handling(tm).
    "There is a major problem with your code, and VB wants to tell you what it is.. but you have decided to put your fingers in your ears and shout 'I'm not listening!'" - si_the_geek on using OERN

  5. #5
    PowerPoster techgnome's Avatar
    Join Date
    May 02
    Posts
    21,653

    Re: Connection string to use Windows Authentication for iSeries in Visual Basic.net 2

    Ok... after now having done a little research... you're right, it does seem all of the examples out there use an explicit username & password in the connection string. I don't know that there's a solution though. There doesn't seem to be a way to indicate to use the existing Windows User and pass it on through. It may have something to do with crossing over to the AS400, or it maybe something else entirely. I want through 4 pages of google results, didn't see anythign that was promissing.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.-I also subscribe to all threads I participate, so there's no need to pm when there's an update.*
    *Proof positive that searching the forums does work: View Thread *
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *
    * Use Offensive Programming, not Defensive Programming. * On Error Resume Next is error ignoring, not error handling(tm).
    "There is a major problem with your code, and VB wants to tell you what it is.. but you have decided to put your fingers in your ears and shout 'I'm not listening!'" - si_the_geek on using OERN

  6. #6
    New Member
    Join Date
    Aug 12
    Posts
    9

    Re: Connection string to use Windows Authentication for iSeries in Visual Basic.net 2

    Thanks techgnome,

    Yes, there are many examples, but with only explicit username and password. I am glad you confirm that with me I was going mad. Thanks for your thoughts.

  7. #7
    New Member
    Join Date
    Sep 12
    Posts
    1

    Re: Connection string to use Windows Authentication for iSeries in Visual Basic.net 2

    Not having ever used iSeries ODBC drivers before, the following may or may not help. The fact that these drivers support both 32 bit and 64 bit operating systems complicates the issue somewhat. If the application is 32 bit, the 32 bit divers are automatically selected, and if the application is 64 bit, the 64 bit drivers are automatically selected. The way to check is to examine the registry entries for ODBC. System DSN's for 32 bit systems are located in HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI, whereas User DSN's for 32 bit systems are located in HKEY_CURRENT_USER\Software\ODBC\ODBC.INI.

    For 64 bit systems, 64 bit DSN's are located in the same place as above, but 32 bit applications will find these entries in HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\ and HKEY_CURRENT_USER\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\. System DSN's can only be updated if the user is logged in as an Adminstrator, and of course User DSN's are only accessible to the appropriate logged in user. I have never used password protected Access files before, but there is provision for a default login/password for each DSN.

    Hope this helps.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •