Sorry guys, here is the code and thanks for your replies.
<%
dim Connect, objRS, objRS1, objConn, objRSU, strSQL
Connect= "DSN=TC-Sin-Av-Dap;DRIVER={Microsoft Access Driver (*.mdb)}"
Set objRS = Server.CreateObject("ADODB.Recordset")
Set objRS1 = Server.CreateObject("ADODB.Recordset")
Set objRSU = Server.CreateObject("ADODB.Recordset")
objRS.Open "test", Connect, adCmdTable
Response.Write "Initial data <br>"
While NOT objRS.EOF
'Display the initial content
Response.Write objRS.Fields("FileID").Value & ", " & objRS.Fields("FileRefTC").Value & ", " & objRS.Fields("FileDesc").Value & "<br>"
objRS.MoveNext
Wend
Response.write "<p></p>"
objRS.Close
set objRS = Nothing
'Now change all FileDesc=A to XX
strSQL = "UPDATE test SET FileDesc = 'XX' WHERE FileDesc = 'A'"
objRSU.Open strSQL, Connect, adCmdText
Response.Write "Updated data <br>"
'Display the content after the changes
objRS1.Open "test", Connect, adCmdTable
While NOT objRS1.EOF
Response.Write objRS1(0) & ", " & objRS1(1) & ", " & objRS1(3) & "<br>"
objRS1.MoveNext
Wend
objRS1.Close
set objRS1 = Nothing
%>
The result page is:
Initial data
1, 030528-1, A
2, 030528-2, A
3, 50103-1, A
4, 50103-1, B
5, 50104-2, B
6, 50104-2, B
7, 50105-1, C
8, 50105-1, C
Updated data
1, 030528-1, A
2, 030528-2, A
3, 50103-1, A
4, 50103-1, B
5, 50104-2, B
6, 50104-2, B
7, 50105-1, C
8, 50105-1, C
The changes are not displayed while in the DB they are done.
Thanks for your help.
|