Re: Application role on connection

From: Happygirl (happygirl5354@hotmail.com)
Date: 02/25/03


From: "Happygirl" <happygirl5354@hotmail.com>
Date: Mon, 24 Feb 2003 21:17:17 -0800


The following are my sample code, i can successfully
execute strsql, but not strsql1, but however if i add one
more line in between "strsql.close", then both statement
can execute successfully, but since the program create
many of this recordset, should you provide any proper and
simple ways.. Thanks.

    Set Conn = New Adodb.Connection
    Conn.ConnectionString = "Driver={SQL Server};SERVER="
& gsSQL70Server & ";UID=" & gsSQL70UID & ";PWD=" &
Decrypt(gsSQL70PWD) & "" & ";DATABASE=" & gsSQL70DATABASE
    Conn.Open
    Conn.Execute "sp_setapprole 'xxAppRole', 'xxAppRole'"

    Dim strSQL As String
    Dim Rst As Adodb.Recordset
    Dim strSQL1 As String
    Dim Rst1 As Adodb.Recordset
      
    strSQL = "SELECT * from Test"
    Set Rst = Conn.Execute(strSQL)
       
    StrSQL1 = "SELECT * from Test";
    Set Rst1 = Conn.Execute(strSQL1)



Relevant Pages

  • Application role on connection
    ... SQL, and then I use "xxAppRole", which has Read access to ... Dim Rst As Adodb.Recordset ... Dim strSQL1 As String ...
    (microsoft.public.sqlserver.security)
  • Re: Application role on connection
    ... execute strsql, but not strsql1, but however if i add one ... Dim Rst As Adodb.Recordset ... Dim strSQL1 As String ...
    (microsoft.public.sqlserver.security)
  • Re: HOW TO Simplify following code
    ... Dim qdf As DAO.QueryDef ... Dim strWhere As String ... Dim strSQL1 As String ...
    (microsoft.public.access.formscoding)
  • Re: Excel 2007 to SQL Server???
    ... Dim cnn As ADODB.Connection ... Dim strSQL1 As String, strConn ... 'Use for SQL server (OLEDB) ...
    (microsoft.public.excel.programming)
  • Re: Connection String to SQL Server in VBA
    ... Security and the DBA doesn't want to make a linked server is the ... But I cannot get the strings to work. ... Dim rst2 As DAO.Recordset ... Dim strConnect, strSQL1 As String ...
    (microsoft.public.access.formscoding)