RE: Executing a DTS Package from VB.NET forms

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi Damian,

The reason you are having trouble is that, from .NET's point of view, you're
trying to call COM DLLs from .NET code. You need to wrap your COM DLL in
something .NET can talk to:
Therefore you need to do four things:

1) Create a strong name key pair file using sn.exe. This enables you to
create an assembly that is uniquely identifiable. Switch to the folder
c:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin and execute:

e.g. sn.exe –k C:\MyDTSKey.KEY

2) Use TlbImp.exe (Type Library Import) to import the main DTS DLL file into
a runtime callable wrapper (RCW) DLL to enable COM to interact with .NET.
e.g. Tlbimp.exe "c:\Program Files\Microsoft SQL
Server\80\Tools\Binn\dtspkg.dll"
/out:c:\Microsoft.SqlServer.DTSPkgDotNet.dll /keyfile:C:\MyDTSKey.KEY

3) Register the RCW in the GAC (Global Assembly Cache):
Gacutil.exe –I c:\Microsoft.SqlServer.DTSPkgDotNet.dll

4) Reference this file in your .NET code.

You're good to go!

Charles Kangai, MCT, MCDBA
Author of Learning Tree's 4-day course: "SQL Server 2005 Integration
Services" http://www.learningtree.com/courses/134.htm
Author of Learning Tree's 4-day course: "SQL Server Reporting Services"
http://www.learningtree.com/courses/523.htm
email alias: charles
email domain: kangai.demon.co.uk



"damian_meleo@xxxxxxxxxxx" wrote:

Hi,

I am getting an error "[DBNETLIB][ConnectionOpen (Connect()).]SQL
Server does not exist or access denied." when I try and execute a DTS
package from VB.NET (forms) using the method LoadFromSQLServer.

I am trying to execute a package from a remote SQL Server. The package
has one connection in it and I use the Server name not (Local) and use
SQL Server authentication ( the user has priviliges on the database). I
can execute the package through Enterprise Manager successfully if i
log into the machine.

I created the package under my windows account ( which is a domain
admin)
I want this windows app to be used by other people so the parameters I
used for the method
LoadFromSQLServer were "server name" , "username", "password",
DTSSQLStgFlag_UseTrustedConnection flag and "package name".

Should I be using my account details for username and password? I can
execute the package if i log into the SQL Server (under my account)

Any help will be appreciated

Cheers
Damian


.



Relevant Pages

  • Re: Run a DTS Package from a web server
    ... Then you need to have that dll registered on every box that runs the DTS ... Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) ... >>> experiment to see if the problem was in the package itself. ...
    (microsoft.public.sqlserver.dts)
  • Re: How to create what VB6 calls an ActiveX EXE
    ... Since you can do SQL CLR, I suggest you use that, as SQL Server has a great level of control over the CLR, and can control the memory management of the CLR, as well as threads and the like so as to optimize its use in SQL Server. ... I have already written a SQLCLR proc that will crash SQL using that dll. ... It sounded as though you wanted to write some .NET code that could be accessed by unmanaged COM code. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: browse for file
    ... I found this package on your site, ... You will need this DLL and also the DTS DLLs on every machine. ... It still isn't a great idea as Allan points out, ... DTS - http://www.sqldts.com PASS - the definitive, global community for SQL Server professionals ...
    (microsoft.public.sqlserver.dts)
  • Re: Question about loading a DLL
    ... tells the package loader how to find/load the package, ... Then you can load/initialize the dll via: ... - load has no path to search ... initialization procedure will have the form pkg_Init, where pkg is the same as ...
    (comp.lang.tcl)
  • Re: Attach to Process does not work?
    ... DLL and one Client which is a EXE. ... Is your application written in .Net code or Win32 native code? ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.vsnet.debugging)