SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Access is denied (Creating a Folder)
 New Topic  Reply to Topic
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 4

SwePeso
Patron Saint of Lost Yaks

Sweden
30217 Posts

Posted - 10/30/2006 :  06:40:41  Show Profile  Visit SwePeso's Homepage  Reply with Quote
You must add the REP account (which you created on the SQL Server machine) to the share located at the remote machine and the remote share.
Now how hard can that be?


Peter Larsson
Helsingborg, Sweden

Edited by - SwePeso on 10/30/2006 06:41:50
Go to Top of Page

gsgill76
Posting Yak Master

India
137 Posts

Posted - 10/30/2006 :  07:15:14  Show Profile  Click to see gsgill76's MSN Messenger address  Send gsgill76 a Yahoo! Message  Reply with Quote
Hi Peter Larsson

Sorry, sorry...
still i am not able to cerate the Shared folder(at client, VSNET1), with account at remote(VSNET5, SQL Server) user(Rep).

Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
30217 Posts

Posted - 10/30/2006 :  07:24:39  Show Profile  Visit SwePeso's Homepage  Reply with Quote
YOU HAVE TO PHYSICALLY SIT AT CLIENT AND CREATE FOLDER MANUALLY.
THEN YOU ADD THE SQL SERVER REP ACCOUNT TO THE REMOTE MACHINE THROGH THE SECURITY MECHANISM.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

mr_mist
Grunnio

United Kingdom
1870 Posts

Posted - 10/30/2006 :  08:31:45  Show Profile  Visit mr_mist's Homepage  Reply with Quote
Clearly you won't be able to create the share and permissions using the account that you're trying to add. That would just be stupid.

You need to use another account - an administrator account might be a good idea - on the remote computer to create the share and set up appropriate security both on the folder itself and on the share. Only then will you be able to access it using your sql server account.


-------
Moo. :)
Go to Top of Page

mr_mist
Grunnio

United Kingdom
1870 Posts

Posted - 10/30/2006 :  08:32:29  Show Profile  Visit mr_mist's Homepage  Reply with Quote
Alternatively, you could hire in Luke Skywalker and get him to use The Force. It's all powerful.

-------
Moo. :)
Go to Top of Page

samuelclay
Yak Posting Veteran

USA
71 Posts

Posted - 10/30/2006 :  15:49:52  Show Profile  Visit samuelclay's Homepage  Reply with Quote
The OP stated that he had set SQL Server Agent to start with the new user, the SQL Server service also has to use that acct for start up.

Edited by - samuelclay on 10/30/2006 15:50:24
Go to Top of Page

gsgill76
Posting Yak Master

India
137 Posts

Posted - 10/31/2006 :  00:42:07  Show Profile  Click to see gsgill76's MSN Messenger address  Send gsgill76 a Yahoo! Message  Reply with Quote
Hi mr_mist
you are right(you understand my problem, how could i create an folder, who having the permission/rights of an account, which is at remote side).
Now what i did is, I create a folder at client( with Administrator Permission/Rights, full controls). but when try to access, same problem.

Hi samuelclay
You are talking about the SQL Server Agent Account. What i did is, the SQL Server Agent Service has account is 'Rep'(have Admin rights) to logon. I mean, this service uses the 'Rep' account.
But still the same Problem.

Hi Peso
Still i am not able to understand how to create such folder?
-------------
Please excuse me, if the problem is on my side( as i had tried my best to sove this)
Please....please
can some body tell me Step by step procedure to over come this problem?
or
what special need to be done?

Kind Regards,
Thanks for your speedy replies
Gurpreet S. Gill

Go to Top of Page

khtan
In (Som, Ni, Yak)

Singapore
17601 Posts

Posted - 10/31/2006 :  00:50:45  Show Profile  Reply with Quote
"still i am not able to cerate the Shared folder(at client, VSNET1), with account at remote(VSNET5, SQL Server) user(Rep)."
"how could i create an folder, who having the permission/rights of an account, which is at remote side"
If I understand you correctly, user Rep has administrators rights in VSNET5. Does user Rep has administrators rights as well in VSNET1 ?


KH

Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
30217 Posts

Posted - 10/31/2006 :  00:58:18  Show Profile  Visit SwePeso's Homepage  Reply with Quote
No need for. Just add account Rep to the shared folder's security tab and maybe even to the folder where the share points to.
Set to Change rights.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

gsgill76
Posting Yak Master

India
137 Posts

Posted - 10/31/2006 :  01:00:58  Show Profile  Click to see gsgill76's MSN Messenger address  Send gsgill76 a Yahoo! Message  Reply with Quote
Hi khtan
Does u mean, both Client as well as Server should have same accounts 'Rep' ?
if so, no i have only one account with name as 'Rep', the SQL Server M/C.
should i try to create on the both m/c, with same account name 'Rep' ?

King Regards,
Thanks.
Gurpreet S. Gill
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
30217 Posts

Posted - 10/31/2006 :  01:05:16  Show Profile  Visit SwePeso's Homepage  Reply with Quote
OMG!
The account REP, that is a Windows account, right?
Go to the client machine. Open Windows Explorer. Click on the directory where you want to save data to, from the SQL Server machine.
Now open the context menu (right click) and select "Sharing..."
In the sharing tab, click "Share this folder".
In the security tab, if everyone already has full control, click OK. If not, add everyone to this folder.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

khtan
In (Som, Ni, Yak)

Singapore
17601 Posts

Posted - 10/31/2006 :  01:05:36  Show Profile  Reply with Quote
"Just add account Rep to the shared folder's security tab"
Provided both machine are on the domain.

Gurpreet, Is the machines on the domain ? If it is standalone machine, it might be easier to create the same account Rep on the Client machine


KH

Go to Top of Page

gsgill76
Posting Yak Master

India
137 Posts

Posted - 10/31/2006 :  01:21:06  Show Profile  Click to see gsgill76's MSN Messenger address  Send gsgill76 a Yahoo! Message  Reply with Quote
Hi Peso
The account REP, that is a Windows account, right? : YES
yes, the shared folder having everyone rights.
But still with same.

Hi khtan
this machine(client) is standalon (No domain).
so i did create the same user 'Rep' with same password.
But same problem.

Regards,
Thanks.
Gurpreet S. Gill
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
30217 Posts

Posted - 10/31/2006 :  02:04:19  Show Profile  Visit SwePeso's Homepage  Reply with Quote
If you still insist on creating the directory thrugh xp_cmdshell, the syntax is "MD" or "MKDIR.
Otherwise, create the folder FIRST (manually and on location on remote machine) and export later.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

gsgill76
Posting Yak Master

India
137 Posts

Posted - 10/31/2006 :  02:22:27  Show Profile  Click to see gsgill76's MSN Messenger address  Send gsgill76 a Yahoo! Message  Reply with Quote
Dear Peso
this is at client side code(written in query SSMS, i try this on the Server too)

declare @sMD varchar(100),@sPath varchar(100)
SET @sPath= '\\vsnet1\c$\newww'
SET @sMD = 'MD ' + @sPath
PRINT @sMD
EXEC xp_cmdshell @sMD

output: Access is denied.

even for the
EXEC xp_cmdshell 'DIR \\vsnet1\c$\pppp'
output: Access is denied.
where 'pppp' is the folder, shared with everyone.

what i had notice:When i am sitting at SQL Server machine & write command
'DIR \\vsnet1\c$\pppp' at command prompt, its working fine, even the MD & MKDIR too.

But using SQL Server getting error.

Regards,
Thanks.
Gurpreet S. Gill

Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
30217 Posts

Posted - 10/31/2006 :  02:38:16  Show Profile  Visit SwePeso's Homepage  Reply with Quote
Try
SET @sMD = 'MD "' + @sPath + '"'

Not only the SHARE has to have the proper permnissions, also the folder for which the share is created.
If you create a new folder under c$ (as pppp or any other name), the parent folder (c$) also need to have everyone and "set child permissions" option set.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

gsgill76
Posting Yak Master

India
137 Posts

Posted - 10/31/2006 :  03:14:25  Show Profile  Click to see gsgill76's MSN Messenger address  Send gsgill76 a Yahoo! Message  Reply with Quote
Man, i dont know where the things are going wrong, i too check the root c$, its already having the 'everyone' share rights(with child permissions too), i too add the 'Administrator + Rep' but the same problem.
Regards,
Thanks.
Gurpreet S. Gill

Go to Top of Page

jen
Flowing Fount of Yak Knowledge

Sweden
4110 Posts

Posted - 10/31/2006 :  04:15:59  Show Profile  Send jen a Yahoo! Message  Reply with Quote
ok first...why do you want to create a folder and write something onto that folder in another server?



--------------------
keeping it simple...
Go to Top of Page

gsgill76
Posting Yak Master

India
137 Posts

Posted - 10/31/2006 :  04:28:56  Show Profile  Click to see gsgill76's MSN Messenger address  Send gsgill76 a Yahoo! Message  Reply with Quote
Jen
Basically, i had created two SPs, one generates the Backup(table+data) & other Restore 4om that backup.
Now the client wants, if he is using the client connectivity tool(SQL Talk in my case), the backup should be stored in the client hard drive, not on the server because not all person having rights to touch the SQL Server.

They want the backup at client folder, right, understand ?

The SP uses the commands like BCP, SQLCMD, SCPTXFR.EXE & to execute then all xp_cmdshell is used.

Now tell me the solution to store at client end. i try the UNC path format but getting this problem

This is the main problem at:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=73562

Regards,
Thanks.
Gurpreet S. Gill

Edited by - gsgill76 on 10/31/2006 04:35:20
Go to Top of Page

khtan
In (Som, Ni, Yak)

Singapore
17601 Posts

Posted - 10/31/2006 :  04:38:37  Show Profile  Reply with Quote
First, make sure this works.
Login to locally to SERVER machine using windows account REP. At the server command prompt, try
DIR \\client_name\C$
DIR \\client_name\shared_name
MD \\client_name\C$\newww

This must work. If it is not working, basically it means the account REP does not have access to the Client Machine.

If you have created the account REP with same password in the client machine than it should work


KH

Go to Top of Page
Page: of 4 Previous Topic Topic Next Topic  
Previous Page | Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.31 seconds. Powered By: Snitz Forums 2000