你用了什么类似于ListBox,StringList之类的控件了吧

解决方案 »

  1.   

    没有这回事吧!也许是你的DELPHI问题。
      

  2.   

    這個我也碰過,仔細看一下你的sql代碼了.不然就貼出來.大家一起來看了.
      

  3.   

    你没有装DELPHI的补丁。装个补丁
      

  4.   

    我的delphi代码是
      storedproc1.params[1].AsString:=edit10.text;   storedproc1.Prepare;
       storedproc1.ExecProc;
       if storedproc1.Params[2].asinteger=1 then
       begin
          messagedlg('此商号名称不存在!',mtwarning,[mbok],0);
          edit10.SetFocus;
          abort;
       end;
    我的storedproc控件的params参数列表为
    0.@RETURN_VALUE
    1.@wealthno
    2.@flag
    我的sql代码是
    use newbaoguan
    go
    if object_id ('testbing_wealthno') is not null
    drop proc testbing_wealthno
    go
    create proc testbing_wealthno
       @wealthno char(6),
      @flag int output
      as
      set @flag=10
    begin tran   if not exists(select * from view_wealthno_bing
                       where view_wealthno_bing.wealthno=@wealthno)
          begin 
            set @flag=1
             rollback tran
             return
            end
     commit tran
         
    我测试sql代码时,若没有输入@flag的值,则系统提醒输入,可@flag 已设为output
    希望各位高手指点迷津
      

  5.   

    DELPHI中,storedproc1 应该从Params[0]开始赋值
      

  6.   

    但params[0]是@return_value,不是自定义参数
      

  7.   

    是参数问题   这样吧!
    ADOStoredProc1.ProcedureName := 'testbing_wealthno;1';ADOStoredProc1.Parameters.Clear;ADOStoredProc1.Parameters.CreateParameter('@ReTurn_value', ftInteger, pdreturnvalue,0,(null));ADOStoredProc1.Parameters.CreateParameter('@wealthno' , ftString, pdInput, 6, edit10.text);
    ADOStoredProc1.Parameters.CreateParameter('@flag', ftinteger, pdOutput, 0, (null));
      

  8.   

    用storedproc1.parameters.paramByName('.@wealthno').
      

  9.   

    storedproc1.parameters.paramByName('@wealthno').
      

  10.   

    我想奉劝你一句,不要什么地方都有prepare,会出问题的,去掉吧,尤其是用ado用到数据构型的时候,100%出错。
      

  11.   

    我将prepare去掉,又将storedproc1.parameters.param[1].asstring改为
    storedproc1.parameters.paramByName('@wealthno').
    又将@flag的paramtype属性改为output
    ,但是出现下列错误情况
        general sql error
     [microsoft] [ODBC SQL SERVER DRIVER]没有提供需要的指示器变量