password creation

  • Hi friends,

    I'm creating an application role, the password for the role should be read from a table. Is it possible to do this?

    The table need to be read is roleconnect has following fields:

    name role_pwd1 role_pwd2

    ----------------------------------------------

    test 'First password' 'Second Password'

    Create application role [from roleconnect.name] with password= ' length of roleconnect.name + first two chars of role_pwd1+ 4rd to 8th chars of role_pwd2 + total length of (role_pwd1+role_pwd2) '

    It should be like:

    create application role test with password = '4Fiond P29'

    I need to script this somehow I'm looking for help how I can do this..Is it possible to create this using a stored procedure? Please give me your suggestions

    Thanks so much

  • newbieuser (8/20/2010)


    Hi friends,

    I'm creating an application role, the password for the role should be read from a table. Is it possible to do this?

    The table need to be read is roleconnect has following fields:

    name role_pwd1 role_pwd2

    ----------------------------------------------

    test 'First password' 'Second Password'

    Create application role [from roleconnect.name] with password= ' length of roleconnect.name + first two chars of role_pwd1+ 4rd to 8th chars of role_pwd2 + total length of (role_pwd1+role_pwd2) '

    It should be like:

    create application role test with password = '4Fiond P29'

    I need to script this somehow I'm looking for help how I can do this..Is it possible to create this using a stored procedure? Please give me your suggestions

    Thanks so much

    since an application would be doing the work, why don't you use .ExecuteNonQuery for your dataadapter or SQL Helper?

    Dim ThePassword as String = [someFormula to make the password]

    Dim sql As String

    sql = " create application role test with password = '" & ThePassword & "'"

    '--SQLHelper Class from Microsoft Data Access Application Block

    'http://www.microsoft.com/downloads/details.aspx?familyid=f63d1f0a-9877-4a7b-88ec-0426b48df275&displaylang=en

    SqlHelper.ExecuteNonQuery(Me.ConnectionString, CommandType.Text, sql)

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Thanks Lowell

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply