Hello,

Can some one tell me where I am going wrong. I am trying to execute a
stored procedure using vbscript. I can execute them in vb6, but cant get it
to work using active server pages.

The problem is : Each time i try to create a command object I get the
error - Activex cant create object ADODB.command. When I create an
ADODB.recordset the compiler passes this.
i.e


****************************************************************************
********
PAGE1. ASP
****************************************************************************
********
<!-- METADATA TYPE="typelib" FILE="C:\Program Files\Common
Files\System\ado\msado15.dll" -->
<!-- #INCLUDE FILE="PAGE2.asp" -->


<SCRIPT LANGUAGE = VBSCRIPT>
sub cmdButton1_onclick
test()
end sub
</SCRIPT>



<HTML>
<%
Response.write "<INPUT TYPE = button Name = cmdButton1 Value = Add>"
%>
</HTML>

****************************************************************************
********
PAGE2.ASP
****************************************************************************
********

<!-- METADATA TYPE="typelib"
FILE="C:\Program Files\Common
Files\System\ado\msado15.dll" -->



<SCRIPT LANGUAGE="VBSCRIPT" >
Function test()
dim objCommand
Dim adoStreamQuery
'Pass this ok
Set obJRs = CreateObject("ADODB.Recordset")

'Fail - Error: Activex component can not create object
ADODB.command
Set objCommand = CreateObject("ADODB.Command")
end function

</script>

Thanks...

Re: createobject("adodb.command") by MikeB

MikeB
Tue Apr 27 14:35:42 CDT 2004


"Bill" <billyhay@haybilly.freeserve.co.uk> wrote in message news:c6mbif$ndm$1@newsg3.svr.pol.co.uk...
> Hello,
>
> Can some one tell me where I am going wrong. I am trying to execute a
> stored procedure using vbscript. I can execute them in vb6, but cant get it
> to work using active server pages.
>
> The problem is : Each time i try to create a command object I get the
> error - Activex cant create object ADODB.command. When I create an
> ADODB.recordset the compiler passes this.
> i.e
>
>
> ****************************************************************************
> ********
> PAGE1. ASP
> ****************************************************************************
> Set obJRs = CreateObject("ADODB.Recordset")
>

all my asp are like:

set oCn = Server.CreateObject("ADODB.Connection")




Re: createobject("adodb.command") by Bob

Bob
Tue Apr 27 15:01:12 CDT 2004

Bill wrote:
> Hello,
>
> Can some one tell me where I am going wrong. I am trying to execute a
> stored procedure using vbscript. I can execute them in vb6, but cant
> get it to work using active server pages.
>
> The problem is : Each time i try to create a command object I get the
> error - Activex cant create object ADODB.command. When I create an
> ADODB.recordset the compiler passes this.
> i.e
>
>
>
****************************************************************************
> ********
> PAGE1. ASP
>
****************************************************************************
<snip> Why show us PAGE1.ASP?
>
****************************************************************************
> ********
> PAGE2.ASP
>
****************************************************************************
> ********
>
> <!-- METADATA TYPE="typelib"
> FILE="C:\Program Files\Common
> Files\System\ado\msado15.dll" -->
>
>
>
> <SCRIPT LANGUAGE="VBSCRIPT" >.

You're doing this in client-side code??
That's a problem. You should be doing this in server-side code. Step back.
Find a book about ASP, or an ASP tutorial on the web. Make sure you
understand the difference between client-side and server-side code before
continuing.


> Function test()
> dim objCommand
> Dim adoStreamQuery
> 'Pass this ok
> Set obJRs = CreateObject("ADODB.Recordset")
>
> 'Fail - Error: Activex component can not create object
> ADODB.command
> Set objCommand = CreateObject("ADODB.Command")
> end function
>

This may be a problem with the MDAC installation on the client machine.
Again, you probably should be doing this in server-side code.

Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.