DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: Setting Roles in .NET

  1. #1
    Join Date
    May 2005
    Posts
    2

    Setting Roles in .NET

    Within the following:
    Code:
        Dim cn As OleDbConnection = _
              New OleDbConnection("Provider=MSDAORA.1;" & _
                                  "Password=IaM123;User ID=Able;" & _
                                  "Data Source=DBWorld")
    
        Dim da As OleDbDataAdapter
        Dim ds As New DataSet
    
        da = New OleDbDataAdapter("SELECT NUM, REV, ID " & _
                                  "FROM   FS " & _
                                  "WHERE  NUM = '22'", _
                                  cn)
        cn.Open()
    
        da.Fill(ds, "Sheets")
    where does one establish the role for the DB contact? (Eg, “SET ROLE FS IDENTIFIED BY FS_APPLROL.”)

  2. #2
    Join Date
    May 2005
    Posts
    2
    Got it!

    Code:
        Dim cn As OleDbConnection = _
              New OleDbConnection("Provider=MSDAORA.1;" & _
                                  "Password=IaM123;User ID=Able;" & _
                                  "Data Source=DBWorld")
    
        Dim da As OleDbDataAdapter
        Dim ds As New DataSet
        Dim cmd As OleDbCommand = _
               New OleDbCommand("SET ROLE FS " & _
                                "IDENTIFIED BY FS_APPLROL", _
                                cn)
        da = New OleDbDataAdapter("SELECT NUM, REV, ID " & _
                                  "FROM   FS " & _
                                  "WHERE  NUM = '22'", _
                                  cn)
        cn.Open()
        cm.ExecuteNonQuery()
    
        da.Fill(ds, "Sheets")

Posting Permissions

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


Click Here to Expand Forum to Full Width