关于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
%> 展开
<%
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
%> 展开
1个回答
展开全部
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
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
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询