Re: Accessing FoxPro Free Table

From: Yama (anonymous_at_discussions.microsoft.com)
Date: 02/25/04


Date: Tue, 24 Feb 2004 18:11:09 -0800

Hi,

Alan Mitchell worte:
Have you specified a UNC path to the .dbf file?

Look at permissions

from BOL

When xp_cmdshell is invoked by a user who is a member of the sysadmin fixed
server role, xp_cmdshell will be executed under the security context in
which the SQL Server service is running. When the user is not a member of
the sysadmin group, xp_cmdshell will impersonate the SQL Server Agent proxy
account, which is specified using xp_sqlagent_proxy_account. If the proxy
account is not available, xp_cmdshell will fail. This is true only for
Microsoft® Windows NT® 4.0 and Windows 2000. On Windows 9.x, there is no
impersonation and xp_cmdshell is always executed under the security context
of the Windows 9.x user who started SQL Server.

Note In earlier versions, a user who was granted execute permissions for
xp_cmdshell ran the command in the context of the MSSQLServer service's user
account. SQL Server could be configured (through a configuration option) so
that users who did not have sa access to SQL Server could run xp_cmdshell in
the context of the SQLExecutiveCmdExec Windows NT account. In SQL Server
7.0, the account is called SQLAgentCmdExec. Users who are not members of the
sysadmin fixed server role now run commands in the context of this account
without specifying a configuration change.

-- 
-- 
Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.allisonmitchell.com - Expert SQL Server Consultancy.
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org
"Yama" <anonymous@discussions.microsoft.com> wrote in message
news:5E71463E-A104-48CE-8DA7-6FFC32434087@microsoft.com...
> CONTINUATION to my previous post:
>> Here is the stored procedure:
>> SET QUOTED_IDENTIFIER ON
> GO
> SET ANSI_NULLS OFF
> GO
>> IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name =
'ExecueDTS')
>      BEGIN
>           PRINT 'Dropping Procedure DtsRun'
>           DROP  Procedure  dbo.ExecueDTS
>      END
>> GO
>> /* ==================================
> AUTHOR: Yama Kamyar
>    ================================== */
> ALTER  Procedure dbo.ExecueDTS
>      @ServerName     VARCHAR(30),
>      @UserName     VARCHAR(30),
>      @Password     VARCHAR(30),
>      @DTSName     VARCHAR(30),
>      @DTSPassword      VARCHAR(30),
>      --WITH ENCRYPTION --Don't use this command but only for production
>      /*
===================================================================
> Encrypting Procedure Definitions
> --------------------------------
> If you are creating a stored procedure and you want
> to make sure that the procedure definition cannot be
> viewed by other users, you can use the WITH ENCRYPTION
> clause. The procedure definition is then stored in an
> unreadable form.
>> After a stored procedure is encrypted, its definition
> cannot be decrypted and cannot be viewed by anyone,
> including the owner of the stored procedure or the system
> administrator.
>
=================================================================== */
> AS
>>      DECLARE @ERROR INT      -- For Hold Error Number
>      DECLARE @CMD     VARCHAR(1000)-- DTS Run Command
>> BEGIN
>      BEGIN TRANSACTION
>      -- Set as No Error
>      SET @ERROR = 0
>      SET @CMD = 'dtsrun /S '+@ServerName+' /U '+@UserName+' /P
'+@Password+' /N '+@DTSName+' /M '+ @DTSPassword
>>      EXECUTE @ERROR = master..xp_cmdshell @CMD
>      -- + Error Checking
>      SELECT @ERROR = COALESCE( NULLIF ( @ERROR, 0 ), @@ERROR )
>      IF @ERROR <> 0 BEGIN ROLLBACK TRANSACTION RETURN @ERROR END
>> END
>      -- Return Error
>      RETURN @ERROR
> GO
>> GRANT EXEC ON dbo.ExecueDTS TO PUBLIC
> GO
>> SET QUOTED_IDENTIFIER OFF
> GO
> SET ANSI_NULLS ON
> GO
>>> When I run this procedure from SQA:
> EXECUTE dbo.ExecuteDTS
>     @ServerName     = 'mySERVER'
>      @UserName     = 'sa'
>      @Password     = 'www.yamabiz.com'
>      @DTSName     = 'myDTS'
>      @DTSPassword      = 'I_dont_like_FoxPro'
>> And I get that error message I wrote in my previous message. You see when
I open SQL Enterprise Manager and run the DTS puppy it doesn't fuss at all
but oh boy does it get on my nerves when I try to run it from SQL Query
Analyser using the stored procedure from above.
>> So after all the talk is done can anyone show me the walk?
>> Thank you for reading and for your consideration,
>> Yama Kamyar
> Sr. Micorsoft .NET Consultant
 
  
  
 
     
     ----- Shevy wrote: -----
     
     Did you ever find a solution? I am having the same problem and have not been able to solve it.
     Any help will be greatly appreciated..
     
     **********************************************************************
     Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
     Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
     


Relevant Pages

  • Re: login password changed
    ... That refers to the DTS method, not the stored procedure method. ... need to edit the file so you get the correct machines name in the account name. ... Tibor Karaszi, SQL Server MVP ... If you have to transfer logins to an instance of SQL Server in a ...
    (microsoft.public.sqlserver.server)
  • SELECT permission denied on object
    ... I have a stored procedure created with another account ... All this stored procedure does is: ... I granted permissions for stored procedure. ... I thought you can manage security in SQL server by using ...
    (microsoft.public.sqlserver.security)
  • Re: ASP and SQL
    ... run a stored procedure in an SQL server from a asp page. ... Is there a way to create a user on an SQL server from a ASP page, ... You will need to use an account with sysadmin privileges in order to execute ...
    (microsoft.public.inetserver.asp.db)
  • Re: How to get list of EventClasses in MSSQLServer2000
    ... statement inside a stored procedure has completed.') ... SQL Server statement or stored procedure.') ... Plan','Displays the plan tree of the Transact-SQL statement executed.') ... Login','Occurs when a SQL Server login is added or removed; ...
    (microsoft.public.sqlserver.security)
  • Re: Error 15401 using sp_grantlogin (not addressed by current KB articles)
    ... Restarting Windows 2000 resolved the problem for this particular account, ... confused when it sees a duplicate SID. ... > One way to get SQL Server to agree with the renamed NT ... > Preview (to ensure the script was created), ...
    (microsoft.public.sqlserver.security)