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??
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"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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?
On second throughts, maybe it's being destroyed or something before I use it. How could I double check the status of conn?
ASKER
AngelIII you were right! Must be an IF statement somewhere stopping the conn from being created.
Thanks for the help!
Thanks for the help!
Hope that helps,
Regards
Greg