Object required error

  • Hai .....,

               Dim oRS

               Set oRS = DTSGlobalVariables("RSTables").Value

    The second line reports the following error:

    Object required: 'oRS'

    This package is created from my machine (machine3) on another machine (machine7). But when I declare and use the same package in my machine (machine3), I don't get this error

    Please help me solve this problem

  • No need to use set.  Just use

    oRS = DTSGlobalVariables("RSTables").Value

    you're in VBScript land here - not SQL Server.

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • OK,

           I removed Set and now it gave me the following error:

    Object variable not set

  • What is the data type for your GV?

  • I 'm binding my GV from a rowset and therefore it is displaying me Dispatch

  • Since you are instantiating your variable to a recordset object, you will need to use "Set" as you originally posted.

    As for why you are unable to access the ADO COM, perhaps we could better assist you if we understood how you were executing the DTS package remotely. Would you provide more details?

  • Hai Don,

    I have created an instance of the remove server in my SQL Server group in EM. And I 'm executing the package from my machine by selecting it, then from the context menu of the selected package, I click Execute Package to execute my Package.

  • Not sure if this is what you need, but I'm assuming that you have a prior step that is running a SQL statement and you are putting the results in RSTables. Whenever I run code like that, I use the following two lines

             Set oRS = CreateObject("Adodb.Recordset")

             set oRS= DTSGlobalVariables("RSTables").Value

    If that doesn't do the trick, I know I've sometimes had mixed results when setting the Output Parameters for a SQL Step. So double check those to make sure they are all set properly.

     

  • First off, you definitely need the SET.

    Second, this does nothing but waste cycles:

    Set oRS = CreateObject("Adodb.Recordset")

    Set oRS= DTSGlobalVariables("RSTables").Value

    oRS is a reference. When you set it to the results of CreateObject, it 'points' to that object and the object's reference count increments. When the 2nd line of code exexutes, oRS now points to something else, and the object created in CreateObject has its reference count decremented and is now a candidate for garbage collection.  IOW wasted cycles constructing a COM object and discarding it on the next line of code.

    Is MDAC installed correctly on the remote machine ? It's important to understand exactly where stuff executes in the DTS world. If a package is on server machine7, but you execute it on your PC, then your PC's CPU and envrionment are running the package, which is why errors due to missing dependencies only show up when running it on the actual remote server.

     

  • Hai

            Thanx for your focus on this topic and trying to solve my problem.

            OK machine3 and machine7 both has VS.NET 2003 installed. Therefore, I guess MDAC installation would be fine. If you want to check me for that, please let me know where and what should I look for in the server machine i.e., some dlls at some location or registration of any dlls, etc.,

            One more thing, My machine machine3 has SP3a installed but not sure about machine7. If this could be the reason, then let me know.

     

Viewing 10 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic. Login to reply