OpenTable




adopenforwardonly=0
adlockoptimistic=3
adstateopen=1
set cn=server.createobject("adodb.connection")
set rs=server.createobject("adodb.recordset")
cn.open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=MIODB_CON_PATH"
rs.activeconnection=cn.connectionstring
rs.cursortype=adopenforwardonly
rs.locktype=adlockoptimistic
'lettura

rs.open "select * from "MIATABELLA"
do while not rs.eof
myvar=rs.fields("MIOCAMPO")
rs.movenext
loop
if rs.state=adstateopen then rs.close
'modifica

rs.open "select * from MIATABELLA WHERE MIOCAMPO=MIOVALORE"
if not rs.eof then
rs.fields("MIOCAMPO")="MIOVALORE"
rs.update
end if
if rs.state=adstateopen then rs.close
'aggiunta

rs.open "select * from MIATABELLA"
rs.addnew
rs.fields("MIOCAMPO")="MIOVALORE"
rs.update
if rs.state=adstateopen then rs.close
'eliminazione

rs.open "select * from MIATABELLA WHERE MIOCAMPO=MIOVALORE"
if not rs.eof then rs.delete
rs.close
set rs=nothing
set cn=nothing
'---====[ pAssed by vbTips32 codeBook ]====---











( opentable.html )- by Paolo Puglisi - Modifica del 17/12/2023