有关ASP向ACCESS数据库写入的问题?求助!

错误类型:
Microsoft JET Database Engine (0x80040E21)
索引或主关键字不能包含一个 空 (Null) 值。
/cm/html/addcontractconsignment.asp, 第 37 行

  • 浏览器类型:
    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Maxthon; TencentTraveler )

联接数据库部分代码:

<%
set Conn=server.createobject("adodb.Connection")
conn.open="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&server.mappath("../datasource/datasource.mdb")
set rs=server.createobject("adodb.recordset")
function connClose
Conn.close
Set conn = Nothing
End Function
function errmsg(message)
session("err")=message
response.redirect"err.asp"
End Function
%>

网页执行代码:

<%
if request("hiddenField")<>"" then
   function k(str,name,size)'isSize

     if len(str)>size then
        call errmsg(name&"字符宽度不能大于"& size)
    end if
   end function

 TheContractNo=k(request("ContractNo"),"合同编号",15)
 TheSignedDate=k(request("SignedDate"),"签约日期",8)

...............

Sql="Select * from ContractM"
 Rs.open Sql,Conn,1,3
 Rs.addnew
 Rs("ContractNo")=TheContractNo
 Rs("SignedDate")=TheSignedDate

 Rs.update(出错部分)
 Rs.close
 Response.redirect"home.asp"
 Response.end
 End if
%>

邮箱:  willianwu@21cn.net  18289842 谢谢!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值