RE: Executing a DTS Package from VB.NET forms
- From: Charles Kangai <CharlesKangai@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 27 Sep 2006 09:43:02 -0700
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
- Follow-Ups:
- RE: Executing a DTS Package from VB.NET forms
- From: Charles Kangai
- RE: Executing a DTS Package from VB.NET forms
- References:
- Executing a DTS Package from VB.NET forms
- From: damian_meleo
- Executing a DTS Package from VB.NET forms
- Prev by Date: openrowset to dbase files, specifically what drivers
- Next by Date: RE: Executing a DTS Package from VB.NET forms
- Previous by thread: Executing a DTS Package from VB.NET forms
- Next by thread: RE: Executing a DTS Package from VB.NET forms
- Index(es):
Relevant Pages
|