【问题标题】:ASP Error - Microsoft JET Database Engine error '80040e07'ASP 错误 - Microsoft JET 数据库引擎错误“80040e07”
【发布时间】:2012-01-10 21:46:03
【问题描述】:

我在注册表格连接到数据库和存储数据时遇到问题,下面是我遇到的错误。

Microsoft JET 数据库引擎错误“80040e07”

条件表达式中的数据类型不匹配。

/mus0280/coursework2/storefuncs.asp,第 330 行

这是代码片段,我检查了数据库和整个网站的数据类型是否相同。

' Add New User to Database
 sqlString = "INSERT INTO users ( " &_
  "user_username, " &_
  "user_password, " &_
  "user_email," &_
  "user_address, " &_
  "user_city," &_
  "user_postcode," &_
  "user_cardnumber, " &_
  "user_cardtype, " &_
  "user_cardexpiremonth," &_
  "user_cardexpireyear," &_
  "user_cardname," &_
  "user_HTML" &_
  ") VALUES ( " &_
  " '" & fixQuotes( newusername ) & "', " &_
  " '" & fixQuotes( newpassword ) & "', " &_
  " '" & fixQuotes( email ) & "', " &_
  " '" & fixQuotes( address ) & "', " &_
  " '" & fixQuotes( city ) & "', " &_
  " '" & fixQuotes( postcode ) & "', " &_
  " '" & fixQuotes( cardnumber ) & "', " &_
  " '" & cardtype & "', " &_
  " '" & cardexpiremonth & "', " &_
  " '" & cardexpireyear & "', " &_
  " '" & fixQuotes( cardname ) & "', " &_
  " "  & html & " " &_
  ")"

Con.Execute sqlString 

- 这是第 330 行

【问题讨论】:

  • 你能把字符串打印出来让我们看看它的最终结果吗?
  • 嗨,对不起,未经编辑的代码,这里是新的,无论如何我发现问题出在文件夹的写权限上。
  • 哇,这个问题的错误信息是什么?
  • @mussi89 请解释您的修复作为答案,以便从 Google 找到此问题的人能够轻松查看修复。

标签: database asp-classic jet


【解决方案1】:
' Try with include single Quote's before and After Html in values (

' Add New User to Database
 sqlString = "INSERT INTO users ( " &_
  "user_username, " &_
  "user_password, " &_
  "user_email," &_
  "user_address, " &_
  "user_city," &_
  "user_postcode," &_
  "user_cardnumber, " &_
  "user_cardtype, " &_
  "user_cardexpiremonth," &_
  "user_cardexpireyear," &_
  "user_cardname," &_
  "user_HTML" &_
  ") VALUES ( " &_
  " '" & fixQuotes( newusername ) & "', " &_
  " '" & fixQuotes( newpassword ) & "', " &_
  " '" & fixQuotes( email ) & "', " &_
  " '" & fixQuotes( address ) & "', " &_
  " '" & fixQuotes( city ) & "', " &_
  " '" & fixQuotes( postcode ) & "', " &_
  " '" & fixQuotes( cardnumber ) & "', " &_
  " '" & cardtype & "', " &_
  " '" & cardexpiremonth & "', " &_
  " '" & cardexpireyear & "', " &_
  " '" & fixQuotes( cardname ) & "', " &_
  " '"  & html & "' " &_
  ")"

Con.Execute sqlString 

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多