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

时间:2012-01-10 21:46:03

标签: database asp-classic jet

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

  

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

     

标准表达式中的数据类型不匹配。

     

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

这是代码snipet,我已经检查过数据库和整个网站的数据类型是否相同。

' 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行

1 个答案:

答案 0 :(得分:0)

' 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