Link to home
Start Free TrialLog in
Avatar of slamhound
slamhound

asked on

Object Required Error on ActiveConnection

I'm getting the below error on trying to set the ActiveConnection
Microsoft VBScript runtime  error '800a01a8'
Object required: 'oCmd.ActiveConnection'

Yet I have code that runs fine using very similar syntax (see the second set of code below)

What am I doing wrong??

Dim oCmd
	
	Set oCmd = Server.CreateObject("ADODB.Command")
 
	Set oCmd.ActiveConnection = conn ' **** Error occurs on this line 
	oCmd.CommandType = adCmdStoredProc
	oCmd.CommandText = "usp_people_create"
 
' Working code
	    Dim oCmd, rsicon
	    		
	    Set oCmd = Server.CreateObject("ADODB.Command")
 
	    Set oCmd.ActiveConnection = conn
	    oCmd.CommandType = adCmdStoredProc
	    oCmd.CommandText = "usp_icon_list"

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You are referring to a stored procedure usp_icon_list, are you able to test this in enterprise managers query builder? I think you will find the fault there...

Hope that helps,
Regards
Greg

Avatar of slamhound
slamhound

ASKER

These are user stored procedures that I've created and work well. conn has been created in another bit of code and works very well as the icon list code successfully creates a list of icons for me.

On second throughts, maybe it's being destroyed or something before I use it. How could I double check the status of conn?
AngelIII you were right! Must be an IF statement somewhere stopping the conn from being created.

Thanks for the help!