Wednesday, March 28, 2012

Invalid working directory sp_adddistpublisher

Sam,
try using a non-administrative share, in the form of
\\computername\repldata.
Rgds,
Paul Ibison, SQL Server MVP,
www.replicationanswers.com/default.asp
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
I shared a directory \\computername\temp. Then put that as the working
directory and I still receive the working directory error.
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:0f7201c53b5b$75466ea0$a601280a@.phx.gbl...
> Sam,
> try using a non-administrative share, in the form of
> \\computername\repldata.
> Rgds,
> Paul Ibison, SQL Server MVP,
> www.replicationanswers.com/default.asp
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
|||Are you on workstation or professional? Sometimes these versions are
limited by the number of simultaneous share accesses.
Run a net stop server and net start server to see if this fixes the
problem.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
|||It still didn't work and I can access the directories when I type them in to
the explorer windows. I believe when I tried running the stored procedure in
query analyzer and it was sucessful. But when I run it from VB it does not
work. All other sp calls are working.
Again here is a repost of my last code section. It is very straightforward
but I don't understand why it works in QA and not VB:
Set cmd = New ADODB.Command
cmd.ActiveConnection = cn
cmd.CommandText = "sp_adddistpublisher"
cmd.CommandType = adCmdStoredProc
cmd.Parameters.Append cmd.CreateParameter("@.publisher", adVarChar,
adParamInput, 255)
cmd.Parameters.Append cmd.CreateParameter("@.distribution_db", adVarChar,
adParamInput, 255)
cmd.Parameters.Append cmd.CreateParameter("@.security_mode", adInteger,
adParamInput)
cmd.Parameters.Append cmd.CreateParameter("@.working_directory", adVarChar,
adParamInput, 255)
cmd.Parameters.Append cmd.CreateParameter("@.trusted", adVarChar,
adParamInput, 255)
cmd.Parameters.Append cmd.CreateParameter("@.thirdparty_flag", adInteger,
adParamInput)
cmd("@.publisher") = "BUSHWACKER"
cmd("@.distribution_db") = "distribution"
cmd("@.security_mode") = 1
cmd("@.working_directory") = "\\BUSHWACKER\C\temp"
cmd("@.trusted") = "false"
cmd("@.thirdparty_flag") = 0
cmd.Execute
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:opsov3eagkrj9kur@.hcottter-lap.ap.org...
> Are you on workstation or professional? Sometimes these versions are
> limited by the number of simultaneous share accesses.
> Run a net stop server and net start server to see if this fixes the
> problem.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
|||Sam,
did you mean to post \\BUSHWACKER\C\temp? Surely it should be
\\BUSHWACKER\temp?
Rgds,
Paul Ibison
"Sam" <sam@.info.com> wrote in message
news:115gblqqpphh46c@.corp.supernews.com...
> It still didn't work and I can access the directories when I type them in
> to
> the explorer windows. I believe when I tried running the stored procedure
> in
> query analyzer and it was sucessful. But when I run it from VB it does
> not
> work. All other sp calls are working.
> Again here is a repost of my last code section. It is very straightforward
> but I don't understand why it works in QA and not VB:
> Set cmd = New ADODB.Command
> cmd.ActiveConnection = cn
> cmd.CommandText = "sp_adddistpublisher"
> cmd.CommandType = adCmdStoredProc
> cmd.Parameters.Append cmd.CreateParameter("@.publisher", adVarChar,
> adParamInput, 255)
> cmd.Parameters.Append cmd.CreateParameter("@.distribution_db", adVarChar,
> adParamInput, 255)
> cmd.Parameters.Append cmd.CreateParameter("@.security_mode", adInteger,
> adParamInput)
> cmd.Parameters.Append cmd.CreateParameter("@.working_directory", adVarChar,
> adParamInput, 255)
> cmd.Parameters.Append cmd.CreateParameter("@.trusted", adVarChar,
> adParamInput, 255)
> cmd.Parameters.Append cmd.CreateParameter("@.thirdparty_flag", adInteger,
> adParamInput)
> cmd("@.publisher") = "BUSHWACKER"
> cmd("@.distribution_db") = "distribution"
> cmd("@.security_mode") = 1
> cmd("@.working_directory") = "\\BUSHWACKER\C\temp"
> cmd("@.trusted") = "false"
> cmd("@.thirdparty_flag") = 0
> cmd.Execute
> "Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
> news:opsov3eagkrj9kur@.hcottter-lap.ap.org...
>
|||yes I used the \\bushwacker\temp in the actual stored procedure. Why does
it work there and not in the source code of vb.
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:#ytrEWUPFHA.3408@.TK2MSFTNGP14.phx.gbl...[vbcol=seagreen]
> Sam,
> did you mean to post \\BUSHWACKER\C\temp? Surely it should be
> \\BUSHWACKER\temp?
> Rgds,
> Paul Ibison
> "Sam" <sam@.info.com> wrote in message
> news:115gblqqpphh46c@.corp.supernews.com...
in[vbcol=seagreen]
procedure[vbcol=seagreen]
straightforward[vbcol=seagreen]
adVarChar,
>
|||Sam,
just to confirm, you previously posted up : cmd("@.working_directory") =
"\\BUSHWACKER\C\temp"
this looks like a copy and paste from a .NET application, and I can't
imagine you retyped it all, so did you later change it and remove the '\C'?
Assuming you have tried \\BUSHWACKER\temp ... I don't have .NET installed on
my virtual PC, but perhaps there is a way you could narrow down the issue.
Create a wrapper stored procedure that calls sp_adddistpublisher and check
it works in QA with no values for the parameters ie set up defaults to each
parameter in the wrapper procedure. Call this proicedure from .NET as you
have done without parameters and check this works. Then add just the wrapper
version of @.working_directory to the parameters collection and send it
through to call the real sp_adddistpublisher. At some stage in the above
process, it should become clearer what the issue is.
Rgds,
Paul Ibison
|||Yes the code I copy and pasted was the code I used after the initial
failure. Sorry for the confusion. I used \\BUSHWACKER\temp
in the code I was testing on before I posted to the newsgroup.
I will try what you have mentioned below. Its a very good idea. I assume
you want to see if its related to permissions or the sp call from vb thats
causing the error. Am I correct?
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:Ozeo#9qPFHA.532@.TK2MSFTNGP09.phx.gbl...
> Sam,
> just to confirm, you previously posted up : cmd("@.working_directory") =
> "\\BUSHWACKER\C\temp"
> this looks like a copy and paste from a .NET application, and I can't
> imagine you retyped it all, so did you later change it and remove the
'\C'?
> Assuming you have tried \\BUSHWACKER\temp ... I don't have .NET installed
on
> my virtual PC, but perhaps there is a way you could narrow down the issue.
> Create a wrapper stored procedure that calls sp_adddistpublisher and check
> it works in QA with no values for the parameters ie set up defaults to
each
> parameter in the wrapper procedure. Call this proicedure from .NET as you
> have done without parameters and check this works. Then add just the
wrapper
> version of @.working_directory to the parameters collection and send it
> through to call the real sp_adddistpublisher. At some stage in the above
> process, it should become clearer what the issue is.
> Rgds,
> Paul Ibison
>
|||Adding the stored procedure to a wrapper worked and when I add it to VB it
works as well.
Why won't it work directly though?
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:Ozeo#9qPFHA.532@.TK2MSFTNGP09.phx.gbl...
> Sam,
> just to confirm, you previously posted up : cmd("@.working_directory") =
> "\\BUSHWACKER\C\temp"
> this looks like a copy and paste from a .NET application, and I can't
> imagine you retyped it all, so did you later change it and remove the
'\C'?
> Assuming you have tried \\BUSHWACKER\temp ... I don't have .NET installed
on
> my virtual PC, but perhaps there is a way you could narrow down the issue.
> Create a wrapper stored procedure that calls sp_adddistpublisher and check
> it works in QA with no values for the parameters ie set up defaults to
each
> parameter in the wrapper procedure. Call this proicedure from .NET as you
> have done without parameters and check this works. Then add just the
wrapper
> version of @.working_directory to the parameters collection and send it
> through to call the real sp_adddistpublisher. At some stage in the above
> process, it should become clearer what the issue is.
> Rgds,
> Paul Ibison
>
|||Sam,
if you can send through the path as a parameter, then this is good news. I
don't know why the original didn't work, and am interested to find out. I'll
take a look when I get .NET installed.
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

No comments:

Post a Comment