1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
| ----------------------------------------------------------------
<%
on error resume next
c1 = request.form("txt_pol")
c2 = request.form("txt_nom")
set Conn = server.createObject("ADODB.Connection")
Conn.provider = "Microsoft.jet.OLEDB.4.0"
Conn.connectionString = "Data Source=" & server.mappath("base.mdb") & ";Persist Security Info=False"
conn.open
Set rs=server.createObject ("ADODB.recordset")
my_sql = "Update client set nom = '" & c2 & "' where pol = '" & c1 & "'"
rs.open my_sql,conn,2,2
rs.close
set rs=nothing
Conn.close
Set conn=nothing
%>
----------------------------------------------------------------------
puis j'ai essayer avec ce code:
---------------------------------------------------------------------
<%
on error resume next
c1 = request.form("txt_pol")
c2 = request.form("txt_nom")
set Conn = server.createObject("ADODB.Connection")
Conn.provider = "Microsoft.jet.OLEDB.4.0"
Conn.connectionString = "Data Source=" & server.mappath("base.mdb") & ";Persist Security Info=False"
conn.open
Set rs=server.createObject ("ADODB.recordset")
my_sql = "Update client set nom = '" & c2 & "' where pol = '" & c1 & "'"
Conn.Execute my_sql
rs.close
set rs=nothing
Conn.close
Set conn=nothing
%>
----------------------------------------------------------------------
puis avec ce code :
-----------------------------------------------------------------------
<%
on error resume next
c1 = request.form("txt_pol")
c2 = request.form("txt_nom")
set Conn = server.createObject("ADODB.Connection")
Conn.provider = "Microsoft.jet.OLEDB.4.0"
Conn.connectionString = "Data Source=" & server.mappath("base.mdb") & ";Persist Security Info=False"
conn.open
Set rs=server.createObject ("ADODB.recordset")
rs.Open "client", conn, 1, 2 ,2
rs.fields("pol")=c1
rs.fields("nom")=c2
rs.update
rs.close
set rs=nothing
Conn.close
Set conn=nothing
%>
----------------------------------------------------------------------- |
Partager