asp提交文本表单 到SQLserver数据库问题 40
cgtjok.asp源码如下:<%dimconnsetconn=server.createobject("ADODB.connection")conn.open"PROV...
cgtjok.asp源码如下:
<%
dim conn
set conn = server.createobject("ADODB.connection")
conn.open "PROVIDER=SQLOLEDB;DATA SOURCE=192.168.8.209;UID=sa;PWD=q1w2e3r4;DATABASE=baite"
%>
<%
set rs=server.CreateObject("adodb.recordset")
sql="insert into dbo.baite_purbill (stockdate,suppid,suppname,prodcode,prodname,prodnum,prodspec,prodquantity,prounit,unitprice,sum,stocktype) VALUES("&request.Form("textfield")&","&request.Form("select")&","&request.Form("select4")&","&request.Form("areaid")&","&request.Form("townid")&","&request.Form("textfield6")&","&request.Form("textfield7")&","&request.Form("textfield8")&","&request.Form("select8")&","&request.Form("textfield14")&","&request.Form("textfield11")&","&request.Form("select3")&")"
rs.open sql,conn
%>
<%
Conn.close
set conn=nothing
%>
以上是我提交到数据库的链接程序,但不知道哪有问题?老是无法提交。还报错,如下:
Microsoft OLE DB Provider for SQL Server ?? '80040e14'',' ????????/cgtjok.asp,? 12
请高手指点 展开
<%
dim conn
set conn = server.createobject("ADODB.connection")
conn.open "PROVIDER=SQLOLEDB;DATA SOURCE=192.168.8.209;UID=sa;PWD=q1w2e3r4;DATABASE=baite"
%>
<%
set rs=server.CreateObject("adodb.recordset")
sql="insert into dbo.baite_purbill (stockdate,suppid,suppname,prodcode,prodname,prodnum,prodspec,prodquantity,prounit,unitprice,sum,stocktype) VALUES("&request.Form("textfield")&","&request.Form("select")&","&request.Form("select4")&","&request.Form("areaid")&","&request.Form("townid")&","&request.Form("textfield6")&","&request.Form("textfield7")&","&request.Form("textfield8")&","&request.Form("select8")&","&request.Form("textfield14")&","&request.Form("textfield11")&","&request.Form("select3")&")"
rs.open sql,conn
%>
<%
Conn.close
set conn=nothing
%>
以上是我提交到数据库的链接程序,但不知道哪有问题?老是无法提交。还报错,如下:
Microsoft OLE DB Provider for SQL Server ?? '80040e14'',' ????????/cgtjok.asp,? 12
请高手指点 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询