主题:  求救!帮我看看错在哪里了

kmdesign

职务:普通成员
等级:1
金币:0.0
发贴:6
#12002/8/1 11:54:06
和sql server的连接没问题,但数据就是进不了库??帮忙,快急死了


<%@ Language=VBScript %>

<%
Option Explicit
function htmlencode2(str)
    dim result
    dim l
    if isNULL(str) then 
       htmlencode2=""
       exit function
    end if
    l=len(str)
    result=""
	dim i
	for i = 1 to l
	    select case mid(str,i,1)
	           case "<"
	                result=result+"<"
	           case ">"
	                result=result+">"
              case chr(13)
	                result=result+"
" case chr(34) result=result+""" case "&" result=result+"&" case chr(32) 'result=result+" " if i+1<=l and i-1>0 then if mid(str,i+1,1)=chr(32) or mid(str,i+1,1)=chr(9) or mid(str,i-1,1)=chr(32) or mid(str,i-1,1)=chr(9) then result=result+" " else result=result+" " end if else result=result+" " end if case chr(9) result=result+" " case else result=result+mid(str,i,1) end select next htmlencode2=result end function on error resume next if request("author")="您的姓名" then response.write "错误提示:请输入您的姓名!
请返回!" response.end end if if request("a101")="" then response.write "错误提示:请输入客户名称!
请返回!" response.end end if if request("a103")="" then response.write "错误提示:请输入客户地址!
请返回!" response.end end if if request("a105")="" then response.write "错误提示:请输入办公电话!
请返回!" response.end end if dim author '表单name dim a101 dim a102 dim a103 dim a104 dim a105 dim a106 dim a107 dim a108 dim a109 dim a110 dim a201 dim a202 dim a203 dim a204 dim a205 dim a206 dim a207 dim a208 dim a209 dim a210 dim a211 dim a212 dim a301 dim a302 dim a303 dim a304 dim a305 dim a306 dim a307 dim a308 dim a309 dim a310 dim a311 dim a312 dim a401 dim a402 dim a403 dim a404 dim a405 dim a406 dim a407 dim a408 dim a409 dim a410 dim a411 dim a412 dim a501 dim a502 dim a503 dim a504 dim a505 dim a506 dim a507 dim a508 dim a509 dim a510 dim a511 dim a512 dim a601 dim a602 dim a603 dim a604 dim a605 dim a606 dim a607 dim a608 dim a701 dim a702 dim a703 dim a704 dim a705 dim a706 dim a707 dim a708 dim a801 dim a802 dim a803 dim a804 dim a901 dim a902 dim a903 dim a904 dim a905 dim a906 dim a907 dim a908 dim a909 dim a910 dim a911 dim a912 dim aa01 dim aa02 dim aa03 dim aa04 dim aa05 dim aa06 dim aa07 dim aa08 dim aa09 dim aa10 dim aa11 dim aa12 dim aa13 dim aa14 dim aa15 dim aa16 dim ab01 dim ab02 dim ab03 dim ab04 dim ab05 dim ab06 author=htmlencode2(request("author")) a101=htmlencode2(request("a101")) a102=htmlencode2(request("a102")) a103=htmlencode2(request("a103")) a104=htmlencode2(request("a104")) a105=htmlencode2(request("a105")) a106=htmlencode2(request("a106")) a107=htmlencode2(request("a107")) a108=htmlencode2(request("a108")) a109=htmlencode2(request("a109")) a110=htmlencode2(request("a110")) a201=htmlencode2(request("a201")) a202=htmlencode2(request("a202")) a203=htmlencode2(request("a203")) a204=htmlencode2(request("a204")) a205=htmlencode2(request("a205")) a206=htmlencode2(request("a206")) a207=htmlencode2(request("a207")) a208=htmlencode2(request("a208")) a209=htmlencode2(request("a209")) a210=htmlencode2(request("a210")) a211=htmlencode2(request("a211")) a212=htmlencode2(request("a212")) a301=htmlencode2(request("a301")) a302=htmlencode2(request("a302")) a303=htmlencode2(request("a303")) a304=htmlencode2(request("a304")) a305=htmlencode2(request("a305")) a306=htmlencode2(request("a306")) a307=htmlencode2(request("a307")) a308=htmlencode2(request("a308")) a309=htmlencode2(request("a309")) a310=htmlencode2(request("a310")) a311=htmlencode2(request("a311")) a312=htmlencode2(request("a312")) a401=htmlencode2(request("a401")) a402=htmlencode2(request("a402")) a403=htmlencode2(request("a403")) a404=htmlencode2(request("a404")) a405=htmlencode2(request("a405")) a406=htmlencode2(request("a406")) a407=htmlencode2(request("a407")) a408=htmlencode2(request("a408")) a409=htmlencode2(request("a409")) a410=htmlencode2(request("a410")) a411=htmlencode2(request("a411")) a412=htmlencode2(request("a412")) a501=htmlencode2(request("a501")) a502=htmlencode2(request("a502")) a503=htmlencode2(request("a503")) a504=htmlencode2(request("a504")) a505=htmlencode2(request("a505")) a506=htmlencode2(request("a506")) a507=htmlencode2(request("a507")) a508=htmlencode2(request("a508")) a509=htmlencode2(request("a509")) a510=htmlencode2(request("a510")) a511=htmlencode2(request("a511")) a512=htmlencode2(request("a512")) a601=htmlencode2(request("a601")) a602=htmlencode2(request("a602")) a603=htmlencode2(request("a603")) a604=htmlencode2(request("a604")) a605=htmlencode2(request("a605")) a606=htmlencode2(request("a606")) a607=htmlencode2(request("a607")) a608=htmlencode2(request("a608")) a701=htmlencode2(request("a701")) a702=htmlencode2(request("a702")) a703=htmlencode2(request("a703")) a704=htmlencode2(request("a704")) a705=htmlencode2(request("a705")) a706=htmlencode2(request("a706")) a707=htmlencode2(request("a707")) a708=htmlencode2(request("a708")) a801=htmlencode2(request("a801")) a802=htmlencode2(request("a802")) a803=htmlencode2(request("a803")) a804=htmlencode2(request("a804")) a901=htmlencode2(request("a901")) a902=htmlencode2(request("a902")) a903=htmlencode2(request("a903")) a904=htmlencode2(request("a904")) a905=htmlencode2(request("a905")) a906=htmlencode2(request("a906")) a907=htmlencode2(request("a907")) a908=htmlencode2(request("a908")) a909=htmlencode2(request("a909")) a910=htmlencode2(request("a910")) a911=htmlencode2(request("a911")) a912=htmlencode2(request("a912")) aa01=htmlencode2(request("aa01")) aa02=htmlencode2(request("aa02")) aa03=htmlencode2(request("aa03")) aa04=htmlencode2(request("aa04")) aa05=htmlencode2(request("aa05")) aa06=htmlencode2(request("aa06")) aa07=htmlencode2(request("aa07")) aa08=htmlencode2(request("aa08")) aa09=htmlencode2(request("aa09")) aa10=htmlencode2(request("aa10")) aa11=htmlencode2(request("aa11")) aa12=htmlencode2(request("aa12")) aa13=htmlencode2(request("aa13")) aa14=htmlencode2(request("aa14")) aa15=htmlencode2(request("aa15")) aa16=htmlencode2(request("aa16")) ab01=htmlencode2(request("ab01")) ab02=htmlencode2(request("ab02")) ab03=htmlencode2(request("ab03")) ab04=htmlencode2(request("ab04")) ab05=htmlencode2(request("ab05")) ab06=htmlencode2(request("ab06")) Dim Cnn, StrCnn Set Cnn = Server.CreateObject("ADODB.Connection") StrCnn = "Provider=sqloledb; User ID=kmd; Password=kmdkmd; Initial Catalog=client_archives; Data Source=127.0.0.1 " conn.open StrCnn set rs=server.createobject("adodb.recordset") sql="select * from sale where (ID is null)" rs.open sql,conn,1,3 rs.addnew rs("author")=author rs("a101")=a101 rs("a102")=a102 rs("a103")=a103 rs("a104")=a104 rs("a105")=a105 rs("a106")=a106 rs("a107")=a107 rs("a108")=a108 rs("a109")=a109 rs("a110")=a110 rs("a201")=a201 rs("a202")=a202 rs("a203")=a203 rs("a204")=a204 rs("a205")=a205 rs("a206")=a206 rs("a207")=a207 rs("a208")=a208 rs("a209")=a209 rs("a210")=a210 rs("a211")=a211 rs("a212")=a212 rs("a301")=a301 rs("a302")=a302 rs("a303")=a303 rs("a304")=a304 rs("a305")=a305 rs("a306")=a306 rs("a307")=a307 rs("a308")=a308 rs("a309")=a309 rs("a310")=a310 rs("a311")=a311 rs("a312")=a312 rs("a401")=a401 rs("a402")=a402 rs("a403")=a403 rs("a404")=a404 rs("a405")=a405 rs("a406")=a406 rs("a407")=a407 rs("a408")=a408 rs("a409")=a409 rs("a410")=a410 rs("a411")=a411 rs("a412")=a412 rs("a501")=a501 rs("a502")=a502 rs("a503")=a503 rs("a504")=a504 rs("a505")=a505 rs("a506")=a506 rs("a507")=a507 rs("a508")=a508 rs("a509")=a509 rs("a510")=a510 rs("a511")=a511 rs("a512")=a512 rs("a601")=a601 rs("a602")=a602 rs("a603")=a603 rs("a604")=a604 rs("a605")=a605 rs("a606")=a606 rs("a607")=a607 rs("a608")=a608 rs("a701")=a701 rs("a702")=a702 rs("a703")=a703 rs("a704")=a704 rs("a705")=a705 rs("a706")=a706 rs("a707")=a707 rs("a708")=a708 rs("a801")=a801 rs("a802")=a802 rs("a803")=a803 rs("a804")=a804 rs("a901")=a901 rs("a902")=a902 rs("a903")=a903 rs("a904")=a904 rs("a905")=a905 rs("a906")=a906 rs("a907")=a907 rs("a908")=a908 rs("a909")=a909 rs("a910")=a910 rs("a911")=a911 rs("a912")=a912 rs("aa01")=aa01 rs("aa02")=aa02 rs("aa03")=aa03 rs("aa04")=aa04 rs("aa05")=aa05 rs("aa06")=aa06 rs("aa07")=aa07 rs("aa08")=aa08 rs("aa09")=aa09 rs("aa10")=aa10 rs("aa11")=aa11 rs("aa12")=aa12 rs("aa13")=aa13 rs("aa14")=aa14 rs("aa15")=aa15 rs("aa16")=aa16 rs("ab01")=ab01 rs("ab02")=ab02 rs("ab03")=ab03 rs("ab04")=ab04 rs("ab05")=ab05 rs("ab06")=ab06 rs("IP")=Request.ServerVariables("Remote_Addr") rs.update rs.close set rs=nothing conn.close set conn=nothing response.write "感谢你提交客户档案。" '提交后可以看见这段话,但是在数据库client_archives中看不到新提交的数据 %>



真心朋友

职务:普通成员
等级:1
金币:0.0
发贴:41
#22002/8/1 15:17:51
我的天,太长了。别人怎么帮你看



5D荣誉版主

职务:普通成员
等级:2
金币:10.0
发贴:658
#32002/8/2 13:33:45
这个问题应该是你的数据连接和打开出了问题你可以仔细检查一下那一部分
或者换一种打开方式?