注册 登录
编程论坛 ASP技术论坛

显示 函数未定义 0x80040E14 错误

liangfengfen 发布于 2010-08-22 23:19, 843 次点击
我 的代码运行到:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="public/appsetting.asp"-->
<!--#include file="public/ado.asp"-->
<!--#include file="public/components.asp"-->
<!--#include file="public/customers.asp"-->

<%
   dim  id,sql,uid
   id=request.QueryString("pid")
   uid="GetCustomerID()"
   
   sql="delete * from t_shopcar where c_code="& uid &" and p_code='"& id &"'"
   datasource.ExecuteCommand(sql)
   
   Set datasource=Nothing
   response.Redirect("shopcar.asp")
%>

就出错了,显示
Microsoft JET Database Engine
错 误 码:0x80040E14

错误代码:cmd.Execute
错误描述:表达式中 'GetCustomerID' 函数未定义。

可是我的GetCustomerID'是写在
<!--#include file="public/customers.asp"-->
里的<%
   function GetCustomerName()
     Dim infos,arr
     infos =Request.Cookies("LoginInfo")
     
     if infos <> "" then
        arr=split(infos,",")
        GetCustomerName=arr(1)
     else
        GetCustomerName=""
     end if
   end function
   
   function GetCustomerID()
      Dim infos,arr
      infos=Request.Cookies("LoginInfo")
      
      if infos<>"" then
         arr=split(infos,",")
         GetCustomerID=arr(0)
      else
         GetCustomerID=-1
      end if
   end function
%>

请帮忙看看啊

10 回复
#2
yms1232010-08-22 23:24
<%
   dim  id,sql,uid
   id=request.QueryString("pid")
   
   uid="GetCustomerID()"
   ’这里多加了双引号
   
   sql="delete * from t_shopcar where c_code="& uid &" and p_code='"& id &"'"
   datasource.ExecuteCommand(sql)
   
   Set datasource=Nothing
   response.Redirect("shopcar.asp")
%>
#3
liangfengfen2010-08-22 23:27
回复 2楼 yms123
不加引号,就出现数据类型不匹配啊
#4
wangjy5002010-08-22 23:30
加 int()转换下看看!
#5
liangfengfen2010-08-22 23:31
回复 4楼 wangjy500
哥 呀,你又出现了,都好久了 ,你都不理才发上来的
#6
liangfengfen2010-08-22 23:36
Microsoft JET Database Engine
错 误 码:0x80040E07

错误代码:cmd.Execute
错误描述:标准表达式中数据类型不匹配。
#7
yms1232010-08-22 23:36
<%
   dim  id,sql,uid
   id=request.QueryString("pid")
   
   uid=CStr(GetCustomerID())

   
   sql="delete * from t_shopcar where c_code="& uid &" and p_code='"& id &"'"
   datasource.ExecuteCommand(sql)
   
   Set datasource=Nothing
   response.Redirect("shopcar.asp")
%>
#8
liangfengfen2010-08-22 23:39
问一下

  sql="delete * from t_shopcar where c_code="& uid &" and p_code='"& id &"'"

  sql="delete * from t_shopcar where c_code="& uid &" and p_code="& id

有什么不同啊


[ 本帖最后由 liangfengfen 于 2010-8-22 23:42 编辑 ]
#9
yms1232010-08-22 23:44
以下是引用liangfengfen在2010-8-22 23:39:11的发言:

问一下

  sql="delete * from t_shopcar where c_code="& uid &" and p_code='"& id &"'"

  sql="delete * from t_shopcar where c_code="& uid &" and p_code="& id

有什么不同啊
p_code='"& id &"'" 这个在SQL语句里表示id为文本类型或字符串
p_code="&id 这个表示为数字类型
#10
liangfengfen2010-08-22 23:46
回复 9楼 yms123
谢谢版主
#11
hams2010-08-23 09:08
把你那个sql变量显示一下就知道了
1