Problem with Stored Procedure (posted for a friend

Results 1 to 4 of 4

Thread: Problem with Stored Procedure (posted for a friend

  1. #1
    Elaine Pack Guest

    Default Problem with Stored Procedure (posted for a friend

    I get the following error when executing a SQL Server stored procedure from my ASP code <BR><BR>ADODB.Command error &#039;800a0bb9&#039; <BR>The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another. <BR>/Accounting/searchdept.asp, line 36 <BR>-------------------------------- <BR>This is my code: <BR>&#060;%<BR>set cn=Server.CreateObject("ADODB.Connection")<BR>cn.O pen("DSN=SLTFILE")<BR>Set cmd = Server.CreateObject("ADODB.Command")<BR>cmd .ActiveConnection = cn<BR>cmd.CommandText = "sp_transbybudget"<BR>cmd.CommandType = adCmdStoredProc<BR>cmd.Parameters.Append cmd.CreateParameter("RetValue", adInteger, adParamReturnValue) <BR>cmd.Parameters.Append cmd.CreateParameter("i_cat", adChar, adParamInput, 1, "1") <BR>cmd.Parameters.Append cmd.CreateParameter("i_fund", adChar, adParamInput, 4, "1000") <BR>cmd.Parameters.Append cmd.CreateParameter("i_dept", adChar, adParamInput, 5, "12200") <BR>Set rstSLT = Server.CreateObject("ADODB.Recordset")<BR>Set rstSlt.cursortype = adOpenStatic<BR>Set rstSlt.LockType = adLockReadOnly<BR>Set rstSlt = cmd.execute<BR>%&#062; <BR>---------------------- <BR>Here is my stored procedure: <BR>CREATE procedure dbo.sp_transbybudget<BR>@i_cat char(1), <BR>@i_fund char(4),<BR>@i_dept char(5) =&#039;______&#039; <BR>AS<BR>Declare @rc int<BR>begin<BR>SELECT * FROM SLTDATA <BR>WHERE slt_cat = @i_cat<BR>and slt_fund = @i_fund<BR>and slt_dept like @i_dept <BR><BR>Can anyone suggest any reasons why she is getting the error above? We are new to stored procedures here.<BR><BR>You can reply directly to if you need more information on this problem.<BR><BR>Thanks!<BR><BR>elaine<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Problem with Stored Procedure (posted for a fr

    cmd.Parameters.Append cmd.CreateParameter("@i_cat", adChar, adParamInput, 1, "1") <BR>cmd.Parameters.Append cmd.CreateParameter("@i_fund", adChar, adParamInput, 4, "1000") <BR>cmd.Parameters.Append cmd.CreateParameter("@i_dept", adChar, adParamInput, 5, "12200") <BR><BR><BR><BR>maybe you should drop the return value one too, it doesn&#039;t seem to do much<BR><BR>j<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: Problem with Stored Procedure (posted for a fr

    Try using<BR>Set rstSlt.LockType = adLockOptimistic<BR><BR>regards<BR>Ganesh

  4. #4
    elaine pack Guest

    Default RE: Problem with Stored Procedure SOLVED

    From another newsgroup she had posted her question to. She said that she included the file and it works fine now.<BR><BR>Thanks to all who wrote.<BR><BR>elaine<BR><BR><BR>&#062;Set rstSlt.cursortype = adOpenStatic<BR>&#062;Set rstSlt.LockType = adLockReadOnly<BR><BR>Have you defined these constants, or included, in a section of the code you didn&#039;t post here?<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts