怎么改才能实现更新?
本人用的是LISTBOX控件:
Dim conn As New OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=" & Server.MapPath("wwwlink.mdb"))
conn.Open()
Dim strsql As String
strsql = "select * from adder"
Dim cmd As New OleDbCommand(strsql, conn)
Dim adp As OleDbDataReader = cmd.ExecuteReader
Dim i As Integer
For i = 0 To dirctList.Items.Count - 1
If dirctList.Items(i).Selected = adp.Read Then
strsql = " update adder set body= '" & Editname.Text & "' where body=' " & dirctList.Items(i).Text & " '"
End If
Next
cmd = New OleDbCommand(strsql, conn)
adp.Close()
cmd.ExecuteNonQuery()
conn.Close()
Call DataBnd()