日期:2014-05-17  浏览次数:20946 次

asp怎么向存储过程传一个ip或者now()的值
'存储过程
create   proc   fatie
@id   varchar(20),
@pwd   varchar(50),
@content   ntext,
@ctime   smalldetatime,
@ip   varchar(15)
as
insert   into   chat   (id,pwd,content,ctime,ip)
value(@id,@pwd,@content,@ctime,@ip)
go

'as代码
id=request( "id ")
pwd=request( "pwd ")
content=request( "content ")
ctime=now()
ip=request( "ip ")
set   rs=server.createobject( "adodb.recordset ")
rs.open   "datie "& "   "& ", "&id& ", "&pwd& ", "&content& ", "&ctime& ", "&ip,conn

报错
Microsoft   OLE   DB   Provider   for   SQL   Server   错误   '80040e14 '  
第   1   行:   '.0 '   附近有语法错误。

如果不传ctime和ip就没问题,用查询分析器exec也没问题

------解决方案--------------------
你的ip应该是nvarchar值吧?!
rs.open "fatie "& " "& ", "&id& ", ' "&pwd& " ', ' "&content& " ', ' "&ctime& " ', ' "&ip& " ',conn
------解决方案--------------------
固定是now()值?