Error in running cmdUpdate

Error in running cmdUpdate

am 27.04.2005 21:51:13 von jack

Hi,
I am testing a asp page where I am trying to run a access update query
from a asp page using the command object. However, it gives the error
as following. I have no idea why the error is coming. Any help is appreciated.
Thanks.
Regards.

ERROR MESSAGE:

ADODB.Command (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another.
/gwisbrandnewready8/test2/arrayparameter_test.asp, line 18

Line 18 is the following:
cmdUpdate.CommandType = adCmdStoredProc


CODE:
<%@ Language=VBScript %>


<% =strTitle %>



<%
Set cnnPubs = Server.CreateObject("ADODB.Connection")
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;"
strConn = strConn & "Data
Source=C:\z_z_z_z_z_ToHaveTableOutPutInTextBoxes\Pubs.mdb"
cnnPubs.Open strConn

Set cmdUpdate = server.CreateObject("ADODB.Command")

cmdUpdate.ActiveConnection = strConn
cmdUpdate.CommandText = "usp_UpdatePrices"
cmdUpdate.CommandType = adCmdStoredProc

cmdUpdate.Execute ,,adExecuteNoRecords

Response.Write "Records have been updated"

%>


Re: Error in running cmdUpdate

am 27.04.2005 22:03:01 von reb01501

Jack wrote:
> Hi,
> I am testing a asp page where I am trying to run a access update query
> from a asp page using the command object. However, it gives the error
> as following. I have no idea why the error is coming. Any help is
> appreciated. Thanks.
> Regards.
>
> ERROR MESSAGE:
>
> ADODB.Command (0x800A0BB9)
> Arguments are of the wrong type, are out of acceptable range, or are
> in conflict with one another.
> /gwisbrandnewready8/test2/arrayparameter_test.asp, line 18
>
> Line 18 is the following:
> cmdUpdate.CommandType = adCmdStoredProc
>
>

The adCmdStoredProc constant is not defined on your page. See:
http://www.aspfaq.com/show.asp?id=2112

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.

Re: Error in running cmdUpdate

am 27.04.2005 22:04:48 von rdanjou

adCmdStoredProc is a constant included in the adovbs.inc file.
Either include the file in your page,
declare the constant in the page "Const adCmdStoredProc = &H0004"
or use the value instead of the variable "cmdUpdate.CommandType = &H0004"

Including "Option Explicit" in your page may help you catch this and other
"variable" problems.

"Jack" wrote in message
news:D5DD3E31-6722-436A-AD84-05253508016C@microsoft.com...
> Hi,
> I am testing a asp page where I am trying to run a access update query
> from a asp page using the command object. However, it gives the error
> as following. I have no idea why the error is coming. Any help is
> appreciated.
> Thanks.
> Regards.
>
> ERROR MESSAGE:
>
> ADODB.Command (0x800A0BB9)
> Arguments are of the wrong type, are out of acceptable range, or are in
> conflict with one another.
> /gwisbrandnewready8/test2/arrayparameter_test.asp, line 18
>
> Line 18 is the following:
> cmdUpdate.CommandType = adCmdStoredProc
>
>
> CODE:
> <%@ Language=VBScript %>
>
>
> <% =strTitle %>
>
>
>
> <%
> Set cnnPubs = Server.CreateObject("ADODB.Connection")
> strConn = "Provider=Microsoft.Jet.OLEDB.4.0;"
> strConn = strConn & "Data
> Source=C:\z_z_z_z_z_ToHaveTableOutPutInTextBoxes\Pubs.mdb"
> cnnPubs.Open strConn
>
> Set cmdUpdate = server.CreateObject("ADODB.Command")
>
> cmdUpdate.ActiveConnection = strConn
> cmdUpdate.CommandText = "usp_UpdatePrices"
> cmdUpdate.CommandType = adCmdStoredProc
>
> cmdUpdate.Execute ,,adExecuteNoRecords
>
> Response.Write "Records have been updated"
>
> %>
>
>
>

Re: Error in running cmdUpdate

am 28.04.2005 00:25:51 von jack

Thanks a lot Bob and Raymond for the help. It works now. Regards

"Raymond D'Anjou" wrote:

> adCmdStoredProc is a constant included in the adovbs.inc file.
> Either include the file in your page,
> declare the constant in the page "Const adCmdStoredProc = &H0004"
> or use the value instead of the variable "cmdUpdate.CommandType = &H0004"
>
> Including "Option Explicit" in your page may help you catch this and other
> "variable" problems.
>
> "Jack" wrote in message
> news:D5DD3E31-6722-436A-AD84-05253508016C@microsoft.com...
> > Hi,
> > I am testing a asp page where I am trying to run a access update query
> > from a asp page using the command object. However, it gives the error
> > as following. I have no idea why the error is coming. Any help is
> > appreciated.
> > Thanks.
> > Regards.
> >
> > ERROR MESSAGE:
> >
> > ADODB.Command (0x800A0BB9)
> > Arguments are of the wrong type, are out of acceptable range, or are in
> > conflict with one another.
> > /gwisbrandnewready8/test2/arrayparameter_test.asp, line 18
> >
> > Line 18 is the following:
> > cmdUpdate.CommandType = adCmdStoredProc
> >
> >
> > CODE:
> > <%@ Language=VBScript %>
> >
> >
> > <% =strTitle %>
> >
> >
> >
> > <%
> > Set cnnPubs = Server.CreateObject("ADODB.Connection")
> > strConn = "Provider=Microsoft.Jet.OLEDB.4.0;"
> > strConn = strConn & "Data
> > Source=C:\z_z_z_z_z_ToHaveTableOutPutInTextBoxes\Pubs.mdb"
> > cnnPubs.Open strConn
> >
> > Set cmdUpdate = server.CreateObject("ADODB.Command")
> >
> > cmdUpdate.ActiveConnection = strConn
> > cmdUpdate.CommandText = "usp_UpdatePrices"
> > cmdUpdate.CommandType = adCmdStoredProc
> >
> > cmdUpdate.Execute ,,adExecuteNoRecords
> >
> > Response.Write "Records have been updated"
> >
> > %>
> >
> >
> >
>
>
>