[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

ASP,SQL Server

Posted on 2001-08-01
4
Medium Priority
?
1,022 Views
Last Modified: 2007-11-27
Thanks in advance!

I have enclosed my code:

I'm receiving the following error:
     Error Type:
ADODB.Parameters (0x800A0E7C)
Parameter object is improperly defined. Inconsistent or incomplete information was provided.
/test/report3.asp, line 157


Line 157 is :      cmd.CommandType =4    


     Set cn = Server.CreateObject("ADODB.Connection")
                                         cn.Open Application("DB")
                                        Set cmd = Server.CreateObject("ADODB.Command")
                                        Set cmd.ActiveConnection = cn
                                        cmd.CommandText = "TrafficReport2"                                        
                                        cmd.CommandType =4    
                                        cmd.Parameters.Append cmd.CreateParameter ("RetVal",  adLongVarChar,adParamReturnValue)
                                        cmd.Parameters.Append cmd.CreateParameter("Param1", adLongVarChar, adParamInput)
                                        cmd.Parameters.Append cmd.CreateParameter("Param2", adLongVarChar, adParamInput)
                                        cmd.Parameters.Append cmd.CreateParameter("Param3", adLongVarChar, adParamInput)
                                        cmd.Parameters.Append cmd.CreateParameter("Param4", adLongVarChar, adParamInput)
                                        cmd.Parameters.Append cmd.CreateParameter("Param5", adLongVarChar, adParamInput)
                                        cmd.Parameters.Append cmd.CreateParameter("Param6", adInteger , adParamInput)
                                        cmd.Parameters.Append cmd.CreateParameter("Param7", adLongVarChar, adParamInput)
                                        cmd.Parameters.Append cmd.CreateParameter("Param8", adLongVarChar, adParamInput)
                               
                                        ' Set value of Param1 of the default collection to 22
                                        cmd("Param1") =  strGroupBy
                                        cmd("Param2") = dtStart
                                        cmd("Param3") = dtEnd
                                        cmd("Param4") = iMarketer
                                        cmd("Param5") =  iSubMarketer
                                        cmd("Param6") = ioffer_id
                                        cmd("Param7") =  strUse
                                        cmd("Param8") =  strGrouping
                                                                           
                                         cmd.Execute   %>
                                        Calling via method 2<BR>
                                        ReturnValue = <% Response.Write cmd(0) %><P><%
0
Comment
Question by:TEALTEAL
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 6

Expert Comment

by:acampoma
ID: 6342185
try this syntax:

    .Parameters.Append( .CreateParameter("BeginId", adVarChar, adParamInput, Len(BeginId), BeginId))
    .Parameters.Append( .CreateParameter("EndId", adVarChar, adParamInput, Len(EndId), EndId))
    .Parameters.Append( .CreateParameter("TableName", adVarChar, adParamInput, Len(TableName), TableName))
0
 
LVL 6

Expert Comment

by:acampoma
ID: 6342189
looks like maybe you forgot some parenthesis
0
 
LVL 2

Expert Comment

by:vspeter
ID: 6342829
I think you've got the wrong driver. I've experienced the same problem when trying to call a stored procedure using ADO object with a DIFFERENT software that's compatible with COM object.
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 150 total points
ID: 6343436
It would be good to see the header of the stored procedure too, but i guess that acampoma's idea goes into the right direction:

the Returnvalue can only be adInteger:
cmd.Parameters.Append cmd.CreateParameter ("RetVal",  adInteger,adParamReturnValue)

char/varchar/... must be defined with their length, integer datatypes not:
cmd.Parameters.Append cmd.CreateParameter("Param1", adVarChar, adParamInput, 100)

seeing the prefixes of your variables for the values, i guess that not all the parameters are LongVarchar, but dates and integers...

In order to define the correct values, you might do this:

cmd.CommandText  "TrafficReport2"                          
cmd.CommandType =4    
cmd.Parameters.Refresh
and then analyse the .Parameters.Collection. This will help you to find the correct values for your code. I recommend not to use the .Refresh in production code because of performance, but for the development it is good trick.

Cheers

                                       



Cheers

0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question