CREATE PROCEDURE arkkccx 

@cxtj      varchar(200) 

as 
DECLARE @STRING1 varchar(200) 
  
set @string1='SELECT hh as 货号,mc as 名称,kk as 款号 from ark where  ' +@cxtj 
exec(@string1) 
GO

解决方案 »

  1.   

    CREATE PROCEDURE arkkccx 

    @cxtj      varchar(200) 

    as 
    DECLARE @STRING1 varchar(200) 
      
    set @string1='SELECT hh as 货号,mc as 名称,kk as 款号 from ark where  ' +@cxtj
    exec(@string1) 
    GO调用:
    exec arkkccx 'mc=''eee'' and hh=''sss'' and kk=''ff''' 
      

  2.   

    cxtj="mc='eee' and hh='sss' and kk='ff'" 
    nresult=SQLExec(connect_temp,"Exec arkkccx ?cxtj ",'rktj') 
    If nresult <0 
    Wait "连接服务器错误" Windows Timeout 2 
    Return 
    ENDIF 
    SQL的存储过程按照这里的回复改为这样
    CREATE PROCEDURE arkkccx 

    @cxtj      varchar(200) 

    as 
    DECLARE @STRING1 varchar(200) 
      
    set @string1='SELECT hh as 货号,mc as 名称,kk as 款号 from ark where  ' +@cxtj
    exec(@string1) 
    GO
      

  3.   

    --楼主,这是什么语法??cxtj 
    nresult=SQLExec(connect_temp,"Exec arkkccx ?cxtj ",'rktj') 
      

  4.   

    \
    这个是什么?  'rktj'
    存储过程写的没错了,VFP语法不是很清楚,建议到VFP版问问。