Encrypted database connection string - InfoPath Dev
in

InfoPath Dev

Encrypted database connection string

Last post 09-09-2005 01:13 AM by Agni Jonnalagadda. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 09-08-2005 09:56 AM

    Encrypted database connection string

    When I connect my InfoPath form to a SQL database, I go through the procedure of creating a connection. Eventually I get a message from InfoPath saying the following:

    "The selected database connection saves passwords in a plain text file. Because plain text files are unencrypted and because the database connection is available to anyone using your InfoPath form, this action is not recommended."

    Do you still want to save your password?"

    If I click No, then when I first run a query / submit on the form it prompts me for the database password. Obviously users who are non-dba are not going to know the password and therefore not going to be able to use the form.

    What's the best way to get around this security problem?

    Cheers, Mark.

  • 09-08-2005 01:45 PM In reply to

    Re: Encrypted database connection string

    I had to refresh myself a little but I was able to get this warning. To get it I:

    1 - Created a user in SQL Server that required a SQL server password and did not user Windows Authentication.
    2 - I then added the user to the Northwind DB.
    3 - Created an InfoPath form, and made a connection to a table in Northwind with that user. Then I got the warning.

    Off hand, you could try to use Windows Authentication for the SQL Server user. I do not know what sort of constraints you may have, so that may not be an option.

    Another option, going down a completely different track, would be to create a web service to return your data. You can code the query using ADO.NET, have the password live in the web service and then return the data to your InfoPath form. Then you do not have to worry about putting a password into your InfoPath form. I have not yet to date made a direction connection to a database, I have always used a web service.
    Jason
    http://www.k2distillery.com/
  • 09-09-2005 01:13 AM In reply to

    Re: Encrypted database connection string

    There is a way where you can work with encrpted connection string. Here are the steps to do it,
    1. Take a DB dataConnecion.
    2. Don't set the connection to be called when the form is loaded.
    3. Prepare your own connection string for the database and encrpyt it and put it in your code as a string or you can have in a config form.
    4. Now open the manifest.xsf and remove the password field value from it.
    5. Open your code get a reference to your dataconnection
    ADOAdapter2 adoConnetion = (ADOAdapter2) thisXDocument.DataAdapters["IndexValue"];
    6. Decrypt your connection string
    string connectionstring = decrypt("encrypted connection string");
    7. Set this connectionstring value to the connection property of adoConnetion.
    adoConnetion.Connection = connectionstring;
    8. Query the connection should get you the data.
    adoConnetion.Query();

    Hope this Helps!

    Agni
    InfoPath Dev India
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.