Re: Create SMS_Package with VB.NET

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Yes, I had remove many line that somes were for connecting to the site...

"Rune Norberg" wrote:

Have you tried connecting to the "root\sms\site_xxx" namespace instead of
"root\sms"?

/Rune

"ShrimpBoy" <ShrimpBoy@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:02F31795-DDCB-49FE-AD1C-51554293A6EF@xxxxxxxxxxxxxxxx
Hi!

I'm trying to create a new SMS_Package with VB.NET...

I have a SMS 2003 server 2.50.4160.2000 on a Win2K3

I got an error on the line with Package.Name = Name that is an
"Unspecified
Error"
and if I put this line under the line for the description, I got an error
on
the line Package.Put_ that is "Generic Failure"...

How can I solve this issue?

Thanks!

ShrimpyOne

Here is my code..

Dim Locator As SWbemLocator
Dim Server As SWbemServices
Dim Package As SWbemObject

Try

Locator = New SWbemLocator
Server = Locator.ConnectServer(SMSServer, "root\sms")

Catch ex As Exception

Locator = Nothing
Server = Nothing
Exit Sub

End Try

Try

Package = Server.Get("SMS_Package").SpawnInstance_
Package.Name = Name
Package.Description = Description
Package.PkgSourceFlag = STORAGE_DIRECT
Package.PkgSourcePath = SourcePath
Package.Put_()

Catch ex As Exception

Package = Nothing
Locator = Nothing
Server = Nothing
Exit Sub

End Try





.



Relevant Pages

  • Object reference not set to an instance of an object.
    ... ASP.NET that uses web service for SQL Server 2000 DB access. ... Exception Details: System.NullReferenceException: Object reference not ... Dim myJobRequest As New skillsDB.jobRequest ... Session= "The skills database has been updated ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Please help !!!! Server Error in Application !! Object variable or
    ... We have hosted an asp.net application in a windows 2003 server machine. ... Dim OnlineConnection As New OnlineConnection ... An unhandled exception occurred during the execution of the ... Please review the stack trace for more information about ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: The process cannot access the file (in Windows2003 only)
    ... Dim sr As StreamReader ... Catch ex As Exception ... Dim sr As StreamReader = File.OpenText ... Server and how I can fix this. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Server not connected, or connection refused.
    ... Dim dele As New GC ... override it to return the exception. ... For one the server code ... > So I have read that tcp has no timeout and using the http timeout ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: Server Error
    ... Dim OnlineConnection As New OnlineConnection ... Dim Trans As SqlClient.SqlTransaction = ... When i run an asp.net application in windows 2003 server with IIS 6.0, ... An unhandled exception occurred during the execution of the ...
    (microsoft.public.dotnet.framework.aspnet)