sql="Update Info Set CatalogId="& CatalogId &",Path='"& Path &"',GroupId="& GroupId &",Title='"& Title &"',Css='"& Css &"',Img='"& Img &"',sImg='"& sImg &"',Author='"& Author &"',Source='"& InfoSource &"',SourceUrl='"& SourceUrl &"',Attach='"& Attach &"',OutUrl='"& OutUrl &"',IsOut="& IsOut &",Content='"& Content &"',UpdateTime='"& UpdateTime &"',Hits="& Hits &",IsHide="& IsHide &",Elite="& Elite &",Hot="& Hot &",SetTop="& SetTop &",Audit="& Audit &",keyword='"& keyword &"',UserId="& UserId &",UserName='"& UserName &"',intro='"& intro &"' Where Id="& Id
conn.execute(sql)
Call ShowMsg("编辑信息成功!","Info.asp?type="& ftype &"&CatalogId="& CatalogId &"&Page="& Page,1500)

解决方案 »

  1.   

    你的语句看上去没什么问题,但是变量里是否存在单引号?你要调试sql连接以后看得到什么结果
      

  2.   

    执行以下代码把sql显示出来,看sql变量的内容是什么,方便调试.sql="Update Info Set CatalogId="& CatalogId &",Path='"& Path &"',GroupId="& GroupId &",Title='"& Title &"',Css='"& Css &"',Img='"& Img &"',sImg='"& sImg &"',Author='"& Author &"',Source='"& InfoSource &"',SourceUrl='"& SourceUrl &"',Attach='"& Attach &"',OutUrl='"& OutUrl &"',IsOut="& IsOut &",Content='"& Content &"',UpdateTime='"& UpdateTime &"',Hits="& Hits &",IsHide="& IsHide &",Elite="& Elite &",Hot="& Hot &",SetTop="& SetTop &",Audit="& Audit &",keyword='"& keyword &"',UserId="& UserId &",UserName='"& UserName &"',intro='"& intro &"' Where Id="& Id
    Call ShowMsg(sql)
      

  3.   

    能不能把sql变量的值贴出来呢,也就是你的拼接成的sql语句贴出来呢?另外,什么是不起作用,是报错,还是这个代码达不到你的要求呢?
      

  4.   

    贴出最终代码是最快的解决方法,目测你那个代码可能存在类型转换问题,比如ID,是否需要用tostring等方法先转换