-
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.”)
-
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")