关于asp 同时写入数据库不同的两个表!!急!!

从api接口接收数据然后插入两个表中请看下边这样行不行?不行的话该怎么办啊?谢谢谢!急!<%dimconn,connstr,TimesDB,rsTimesDB="#sun... 从api接口接收数据 然后插入两个表中 请看下边这样行不行? 不行的话该怎么办啊?谢谢谢!急!

<%
dim conn,connstr,TimesDB,rs
TimesDB="#sundxShopssdcuoyy.asp"
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&TimesDB&"")
On Error Resume Next
Set conn = Server.CreateObject("ADODB.Connection")
conn.open connstr
If Err Then
err.Clear
Set Conn = Nothing
Response.Write "数据库连接出错,请检查连接字串。"
Response.End
End If
%>

<%
yyyymmdd=request.QueryString("yyyymmdd")
u_id=request.QueryString("u_id")
o_cd=request.QueryString("o_cd")
mbr_id=request.QueryString("mbr_id")
m_id=request.QueryString("m_id")
p_cd=request.QueryString("p_cd")
it_cnt=request.QueryString("it_cnt")
comm=request.QueryString("comm")
price=request.QueryString("price")
c_cd=request.QueryString("c_cd")

'以下是写库语句.

strSQL="insert into dingdan(shopid,ordernum,memberzhanghao,productnum,productprice,productshuliang,orderstate,fanlistate,yongjin,inputdate) values('" &m_id& "','" &o_cd & "','" &u_id& "','" &p_cd& "'," &price& "," &it_cnt& ",0,0," &comm*.6& ",'" &date& "')"

strSQL="insert into orders(receipt,orderid,userid,postcode,goods,address,state,fanlistate,productnum,remarks) values('" &m_id& "','" &o_cd & "','" &u_id& "','" &p_cd& "'," &price& "," &it_cnt& ",0,0," &comm*.6& ",'" &date& "')"
conn.execute strsql

%>
展开
 我来答
百度网友41da067
2010-01-03 · TA获得超过192个赞
知道小有建树答主
回答量:294
采纳率:100%
帮助的人:194万
展开全部
strSQL="insert into dingdan(shopid,ordernum,memberzhanghao,productnum,productprice,productshuliang,orderstate,fanlistate,yongjin,inputdate) values('" &m_id& "','" &o_cd & "','" &u_id& "','" &p_cd& "'," &price& "," &it_cnt& ",0,0," &comm*.6& ",'" &date& "')"
conn.execute strSQL

strSQL="insert into orders(receipt,orderid,userid,postcode,goods,address,state,fanlistate,productnum,remarks) values('" &m_id& "','" &o_cd & "','" &u_id& "','" &p_cd& "'," &price& "," &it_cnt& ",0,0," &comm*.6& ",'" &date& "')"
conn.execute strSQL
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式