以下分别是这两个文件,我想批量把 只要ParId等于000040000100001的 preprice4的值都改成1
下面有语法错误,帮忙看看!
db.asp
1
2dim strConnString , strSql
3strConnString = "driver={SQL Server};server=LEXON;uid=sa;pwd=123;database=grasp"
price1.asp
1
2set Rs=server.CreateObject("ADODB.RecordSet")
3Rs.Open strConnString
4
5strSql = "select * from ptype where ParId=000040000100001"
6set Rs = Rs.Execute(strSql)
7do while not Rs.EOF
8Rs("preprice4")=1
9Rs.update
10Rs.MoveNext()
11loop
12Rs.Close
---------------------------------------------------------------
set Rs=server.CreateObject("ADODB.RecordSet")
Rs.Open strConnString
strSql = "select * from ptype where ParId=000040000100001"
set Rs = Rs.Execute(strSql)
do while not Rs.EOF
Rs("preprice4")=1
Rs.update
Rs.MoveNext()
loop
Rs.Close
这段改成
set conn=server.CreateObject("ADODB.Connection")
conn.Open strConnString
strSql="update ptype set preprice4=1 where ParId='000040000100001'"
conn.execute(strSql)
即可