!!!!急!在线等待!!连接数据库问题!!
我再本机设置数据源BCA 为什么提交数据出错
set conn=server.createobject("adodb.connection")
conn.Open Application("dsn")
strSQL = "insert into BCAWeb_Question(name,CompanyName,linkWay,Tilte,memo) values ('" &strName & "','" &strCompany& "','" &strlink& "','" &strTitle& "','" &strQuestion& "')"
conn.Execute strSQL
conn.close
set conn = nothing
换成下面也不好使:
<%
Dim strName,strCompany,strlink,strTitle,strQuestion
strTitle = Request.Form("textfield4")
strTitle = Trim(strTitle)
strTitle = replace(strTitle,"'","''")
strTitle = server.HTMLEncode(strTitle)
strQuestion = Request.Form("textfield4")
strQuestion = replace(strQuestion,"'","''")
strQuestion = replace(strQuestion,"<","<")
strQuestion = replace(strQuestion,">",">")
strName = Request.Form("textfield")
strCompany = Request.Form("textfield2")
strlink = Request.Form("textfield3")
set conn=server.createobject("adodb.connection")
Connstr="Provider=SQLOLEDB;Data Source=hf;UID=sa;PWD=sa;DataBase=BCAWeb"
conn.open connstr
set rec=server.createobject("adodb.recordset")
rec.open "select * from BCAWeb_Question where id is null",connstr,1,3
rec.AddNew
rec("name") = strname
rec("Companyname") = strCompany
rec("LinkWay") = strLink
rec("Title") = strTitle
rec("memo") = strQuestion
rec.Update
rec.Close
set rec = nothing
conn.Close
set conn = nothing
response.redirect "level3.htm"
%>
各位大侠帮忙!!小弟很急!!就10分了 ,都给了!!谢谢了