|
请教大家 怎么做到数据库有相同的就不写入呢?
dim conn,db,rs,sql,connstr
set conn = server.CreateObject("adodb.connection")
'connstr="DBQ="+server.mappath("data.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
db = "data.mdb"
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(db)
conn.open connstr
set rs=server.CreateObject("ADODB.RecordSet")
sql="select * from house"
rs.open sql,conn,1,3
Rs.AddNew
Rs("name")=trim(fcfangWDO.Rs(0))
Rs("sname")=trim(fcfangWDO.Rs(3))
Rs("price")=trim(fcfangWDO.Rs(2))
Rs("yzbm")=trim(fcfangWDO.Rs(1))
Rs("phone")=trim(fcfangWDO.Rs(4))
Rs("c_id")="98"
Rs.Update |
|