当前位置: 代码迷 >> ASP >> 关于rs.addnew的有关问题
  详细解决方案

关于rs.addnew的有关问题

热度:112   发布时间:2012-04-25 19:32:32.0
关于rs.addnew的问题
<%
dim rs,strSql
set rs=server.CreateObject("adodb.recordset")

'********************打开客户记录集********************
strSql="select * from Tab_Market_Customer"
rs.open strSql,Conn,1,3
rs.addnew


'********************客户基本信息********************
rs("Cl_BusinessName")=request.Form("txt_BusinessName")
rs("Cl_Holder")=request.Form("txt_Holder")
rs("Cl_CompanyName")=request.Form("txt_CompanyName")
rs("Cl_Classify")=request.Form("sel_Classify")
rs("Cl_Industry")=request.Form("sel_Industry")
rs("Cl_State")=request.Form("sel_State")
rs("Cl_StaffSize")=request.Form("sel_StaffSize")
rs("Cl_Source")=request.Form("sel_Source")
rs("Cl_Income")=request.Form("txt_Income")
rs("Cl_Maturity")=request.Form("sel_Maturity")
rs("Cl_RealityMoney")=request.Form("txt_RealityMoney")
rs("Cl_PredictMoney")=request.Form("txt_PredictMoney")
rs("Cl_IntentionProducts")=request.Form("txt_IntentionProducts")
rs("Cl_CustomerRemark")=request.Form("txt_CustomerRemark")
rs("Cl_Hot")=request.Form("rad_Hot")


'********************客户联系方式********************
rs("Cl_Area")=request.Form("txt_Area")
rs("Cl_Telephone")=request.Form("text_CoTelephone")
rs("Cl_Town")=request.Form("text_Town")
rs("Cl_Fax")=request.Form("txt_CoFax")
rs("Cl_Postcode")=request.Form("txt_Postcode")
rs("Cl_URL")=request.Form("txt_URL")
rs("Cl_ContactRemark")=request.Form("txt_ContactRemark")
rs("Cl_Creator")="yao"
rs("Cl_CreateTime")=now()
rs("Cl_EditTime")=now()
rs.update
dim intCustomerID
intCustomerID=rs("Cl_ID")'获取客户信息的“Cl_ID”

'********************打开联系人记录集********************
strSql="select * from Tab_Market_Linkman"
Conn.execute(strSql)
rs.addnew
rs("Cl_Holder")=request.Form("txt_Holder")
rs("Cl_Name")=request.Form("txt_LinkmanName")
rs("Cl_Mobile")=request.Form("text_LMMobile")
rs("Cl_Telephone")=request.Form("txt_LMTelephone")
rs("Cl_Salutation")=request.Form("txt_Salutation")
rs("Cl_Fax")=request.Form("txt_LMFax")
rs("Cl_Email")=request.Form("txt_LMEmail")
rs("Cl_Position")=request.Form("txt_Position")
rs("Cl_ElseContact")=request.Form("txt_ElseContact")
rs("Cl_LMRemark")=request.Form("txt_LMRemark")
rs("Cl_Sex")=request.Form("rad_Sex")
rs("Cl_Chiefly")=request.Form("rad_Chiefly")
rs("Cl_CreateTime")=now()
rs.update
dim intLinkmanID
intLinkmanID=rs("Cl_ID")'获取联系人信息的"Cl_ID"

'********************打开客户与联系人关系记录集********************
strSql="select * from Tab_Market_CLRelation"
Conn.execute(strSql)
rs.addnew
rs("Cl_CustomerID")=intCustomerID
rs("Cl_LinkmanID")=intLinkmanID
rs.update

'********************关闭记录集,关闭数据库链接********************
rs.close
set rs=nothing
Conn.close
set Conn=nothing

response.Write("<script language=javascript>succeed()</script>")'弹出成功对话框
%>
在打开联系人记录集时报错了,请各位帮忙看下啊,不胜感激!

------解决方案--------------------