Thursday, February 9, 2012

Access denied on ScriptTransfer call

Hi,
I wrote an application which connects to the SQL Server with the "sa"
login. It is then calling the "ScriptTransfer" method on a Database
object, in order to obtain the SQL scripts behind a database.
Unfortunately it throws an "access denied" exception on the method
call.
Do you know where should i set the correct permissions for the
operation to execute successfully?The likely cause is that your target ScriptFile specification isn't
consistent for the specified ScriptFileMode. ScriptFile can specify either
a folder or file, depending on the specified ScriptFileMode. You might get
an 'access denied' error if you indicated the single script file option but
specified a folder as the ScriptFile.
Hope this helps.
Dan Guzman
SQL Server MVP
"Hans Ruck 2" <bogdanrechi.code@.gmail.com> wrote in message
news:1141898584.381427.16160@.j52g2000cwj.googlegroups.com...
> Hi,
> I wrote an application which connects to the SQL Server with the "sa"
> login. It is then calling the "ScriptTransfer" method on a Database
> object, in order to obtain the SQL scripts behind a database.
> Unfortunately it throws an "access denied" exception on the method
> call.
> Do you know where should i set the correct permissions for the
> operation to execute successfully?
>

No comments:

Post a Comment